# HG changeset patch # User kashif.sayed # Date 1269549961 -19800 # Node ID c98d4e1e5d8e0ea55bbc053cb3fd7955d05a41cc # Parent 28544f9237c7747edb49dafdd1a0975163e5db60 user: kashif.sayed added dependencies/ssm/ssmdomaindefs.h added dependencies/ssm/ssmstate.h added dependencies/ssm/ssmstateawaresession.h changed dependencies/ssm/bld.inf diff -r 28544f9237c7 -r c98d4e1e5d8e dependencies/ssm/bld.inf --- a/dependencies/ssm/bld.inf Fri Mar 26 02:10:38 2010 +0530 +++ b/dependencies/ssm/bld.inf Fri Mar 26 02:16:01 2010 +0530 @@ -3,4 +3,7 @@ simutils.h ssm\simutils.h startupdomainpskeys.h ssm\startupdomainpskeys.h -startupreason.h ssm\startupreason.h \ No newline at end of file +startupreason.h ssm\startupreason.h +ssmdomaindefs.h ssm\ssmdomaindefs.h +ssmstate.h ssm\ssmstate.h +ssmstateawaresession.h ssm\ssmstateawaresession.h \ No newline at end of file diff -r 28544f9237c7 -r c98d4e1e5d8e dependencies/ssm/ssmdomaindefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/ssm/ssmdomaindefs.h Fri Mar 26 02:16:01 2010 +0530 @@ -0,0 +1,524 @@ +// Copyright (c) 2005-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: +// + +#if !defined (__SSMDOMAINDEFS_H__) +#define __SSMDOMAINDEFS_H__ + +#include + +/** +@publishedPartner +@released + +The first domain in the HAL level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2HALDomain1 = 10; + +/** +@publishedPartner +@released + +The second domain in the HAL level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2HALDomain2 = 20; + + +/** +@publishedPartner +@released + +The third domain in the HAL level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2HALDomain3 = 30; + +/** +@publishedPartner +@released + +The fourth domain in the HAL level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2HALDomain4 = 40; + +/** +@publishedPartner +@released + +The fifth domain in the HAL level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2HALDomain5 = 50; + +/** +@publishedPartner +@released + +The first domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2KernelServicesDomain1 = 60; + +/** +@publishedPartner +@released + +The second domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2KernelServicesDomain2 = 70; + +/** +@publishedPartner +@released + +The third domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2KernelServicesDomain3 = 80; + +/** +@publishedPartner +@released + +The fourth domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2KernelServicesDomain4 = 90; + +/** +@publishedPartner +@released + +The fifth domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2KernelServicesDomain5 = 100; + +/** +@publishedPartner +@released + +The first domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2OSServicesDomain1 = 110; + +/** +@publishedPartner +@released + +The second domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2OSServicesDomain2 = 120; + +/** +@publishedPartner +@released + +The third domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2OSServicesDomain3 = 130; + +/** +@publishedPartner +@released + +The fourth domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2OSServicesDomain4 = 140; + +/** +@publishedPartner +@released + +The fifth domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2OSServicesDomain5 = 150; + +/** +@publishedPartner +@released + +The first domain in the Generic Middleware level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2GenMiddlewareDomain1 = 160; + +/** +@publishedPartner +@released + +The second domain in the Generic Middleware level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2GenMiddlewareDomain2 = 170; + + +/** +@publishedPartner +@released + +The third domain in the Generic Middleware level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2GenMiddlewareDomain3 = 180; + + +/** +@publishedPartner +@released + +The fourth domain in the Generic Middleware level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2GenMiddlewareDomain4 = 190; + +/** +@publishedPartner +@released + +The fifth domain in the Generic Middleware level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2GenMiddlewareDomain5 = 200; + +/** +@publishedPartner +@released + +The first domain in the Application Service level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2AppServicesDomain1 = 210; + +/** +@publishedPartner +@released + +The second domain in the Application Service level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2AppServicesDomain2 = 220; + +/** +@publishedPartner +@released + +The third domain in the Application Service level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2AppServicesDomain3 = 230; + +/** +@publishedPartner +@released + +The fourth domain in the Application Service level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2AppServicesDomain4 = 240; + + +/** +@publishedPartner +@released + +The fifth domain in the Application Service level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KSM2AppServicesDomain5 = 250; + + +/** +@publishedPartner +@released + +The first domain in the UI Service level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiServicesDomain1 = 260; + +/** +@publishedPartner +@released + +The second domain in the UI Service level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiServicesDomain2 = 270; + + +/** +@publishedPartner +@released + +The third domain in the UI Service level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiServicesDomain3 = 280; + + +/** +@publishedPartner +@released + +The fourth domain in the UI Service level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiServicesDomain4 = 290; + + +/** +@publishedPartner +@released + +The fifth domain in the UI Service level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiServicesDomain5 = 300; + +/** +@publishedPartner +@released + +The first domain in the UI Application level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiApplicationDomain1 = 310; + +/** +@publishedPartner +@released + +The second domain in the UI Application level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiApplicationDomain2 = 320; + +/** +@publishedPartner +@released + +The third domain in the UI Application level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiApplicationDomain3 = 330; + +/** +@publishedPartner +@released + +The fourth domain in the UI Application level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiApplicationDomain4 = 340; + +/** +@publishedPartner +@released + +The fifth domain in the UI Application level of the Startup Domain Hierarchy. +Used by the Licensees mainly. +**/ +static const TDmDomainId KSM2UiApplicationDomain5 = 350; + + +// +// Existing ones taken from StartupDomainDefs.h +// +/** +@publishedPartner +@deprecated + +The first domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KKernelServicesDomain1 = KSM2KernelServicesDomain1; + +/** +@publishedPartner +@deprecated + +The second domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KKernelServicesDomain2 = KSM2KernelServicesDomain2; + +/** +@publishedPartner +@deprecated + +The third domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KKernelServicesDomain3 = KSM2KernelServicesDomain3; + +/** +@publishedPartner +@deprecated + +The fourth domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KKernelServicesDomain4 = KSM2KernelServicesDomain4; + +/** +@publishedPartner +@deprecated + +The fifth domain in the Kernel Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KKernelServicesDomain5 = KSM2KernelServicesDomain5; + +/** +@publishedPartner +@deprecated + +The first domain in the Base Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KBaseServicesDomain1 = KSM2OSServicesDomain1; + +/** +@publishedPartner +@deprecated + +The second domain in the Base Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KBaseServicesDomain2 = KSM2OSServicesDomain2; + +/** +@publishedPartner +@deprecated + +The third domain in the Base Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KBaseServicesDomain3 = KSM2OSServicesDomain3; + +/** +@publishedPartner +@deprecated + +The fourth domain in the Base Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KBaseServicesDomain4 = KSM2OSServicesDomain4; + +/** +@publishedPartner +@deprecated + +The fifth domain in the Base Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KBaseServicesDomain5 = KSM2OSServicesDomain5; + +/** +@publishedPartner +@deprecated + +The first domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KOSServicesDomain1 = KSM2GenMiddlewareDomain1; + +/** +@publishedPartner +@deprecated + +The second domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KOSServicesDomain2 = KSM2GenMiddlewareDomain2; + +/** +@publishedPartner +@deprecated + +The third domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KOSServicesDomain3 = KSM2GenMiddlewareDomain3; + +/** +@publishedPartner +@deprecated + +The fourth domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KOSServicesDomain4 = KSM2GenMiddlewareDomain4; + +/** +@publishedPartner +@deprecated + +The fifth domain in the OS Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KOSServicesDomain5 = KSM2GenMiddlewareDomain5; + +/** +@publishedPartner +@deprecated + +The first domain in the AppServices Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KAppServicesDomain1 = KSM2AppServicesDomain1; + +/** +@publishedPartner +@deprecated + +The second domain in the AppServices Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KAppServicesDomain2 = KSM2AppServicesDomain2; + +/** +@publishedPartner +@deprecated + +The third domain in the AppServices Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KAppServicesDomain3 = KSM2AppServicesDomain3; + +/** +@publishedPartner +@deprecated + +The fourth domain in the AppServices Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KAppServicesDomain4 = KSM2AppServicesDomain4; + +/** +@publishedPartner +@deprecated + +The fifth domain in the AppServices Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KAppServicesDomain5 = KSM2AppServicesDomain5; + +/** +@publishedPartner +@deprecated + +The first domain in the UIFrameworkDomain Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KUIFrameworkDomain1 = KSM2UiServicesDomain1; + +/** +@publishedPartner +@deprecated + +The second domain in the UIFrameworkDomain Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KUIFrameworkDomain2 = KSM2UiServicesDomain2; + +/** +@publishedPartner +@deprecated + +The third domain in the UIFrameworkDomain Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KUIFrameworkDomain3 = KSM2UiServicesDomain3; + +/** +@publishedPartner +@deprecated + +The fourth domain in the UIFrameworkDomain Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KUIFrameworkDomain4 = KSM2UiServicesDomain4; + +/** +@publishedPartner +@deprecated + +The fifth domain in the UIFrameworkDomain Services level of the Startup Domain Hierarchy +**/ +static const TDmDomainId KUIFrameworkDomain5 = KSM2UiServicesDomain5; + +#endif // __SSMDOMAINDEFS_H__ + diff -r 28544f9237c7 -r c98d4e1e5d8e dependencies/ssm/ssmstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/ssm/ssmstate.h Fri Mar 26 02:16:01 2010 +0530 @@ -0,0 +1,69 @@ +// Copyright (c) 2007-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 __SSMSTATE_H__ +#define __SSMSTATE_H__ + +#include +#include + +/** + The maximum length of a System State Name + + @see TSsmState + + @publishedPartner + @released + */ +const TInt KMaxSsmStateName = 11; + +/** + A buffer for a System State Name + + @see TSsmState + + @publishedPartner +@released + */ +typedef TBuf TSsmStateName; + +/** + Encapsulates the System State. + + @publishedPartner +@released + */ +NONSHARABLE_CLASS(TSsmState) + { +public: + IMPORT_C TSsmState(); + IMPORT_C TSsmState(TSsmMainSystemStates aMainState, TUint16 aSubState); + IMPORT_C TSsmState(TUint16 aMainState, TUint16 aSubState); + IMPORT_C TSsmState(const TSsmState& aState); + IMPORT_C TUint16 MainState() const; + IMPORT_C TUint16 SubState() const; + IMPORT_C void Set(TUint16 aMainState, TUint16 aSubState); + IMPORT_C TUint32 Int() const; + IMPORT_C void SetFromInt(TUint32 aValue); + IMPORT_C TSsmStateName Name() const; + IMPORT_C TSsmState& operator=(const TSsmState& aState); + IMPORT_C TBool operator==(const TSsmState& aState) const; + IMPORT_C TBool operator!=(const TSsmState& aState) const; +private: + TUint16 iMainState; + TUint16 iSubState; + }; + +#endif diff -r 28544f9237c7 -r c98d4e1e5d8e dependencies/ssm/ssmstateawaresession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/ssm/ssmstateawaresession.h Fri Mar 26 02:16:01 2010 +0530 @@ -0,0 +1,107 @@ +// Copyright (c) 2007-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 __SSMSTATEAWARESESSION_H__ +#define __SSMSTATEAWARESESSION_H__ + +#include +#include + +#include + +class CSsmStateMonitor; + +/** +Read-only client interface to receive notifications when the +System State changes. + +CSsmStateAwareSession wraps this class in an active object. + +@see CSsmStateAwareSession +@publishedPartner +@released +*/ +NONSHARABLE_CLASS(RSsmStateAwareSession) + { +public: + IMPORT_C RSsmStateAwareSession(); + IMPORT_C TInt Connect(TDmDomainId aId); + IMPORT_C void Close(); + IMPORT_C TSsmState State() const; + IMPORT_C void RequestStateNotification(TRequestStatus& aStatus); + IMPORT_C void RequestStateNotificationCancel(); + IMPORT_C void AcknowledgeStateNotification(TInt aError); + IMPORT_C void AcknowledgeAndRequestStateNotification(TInt aError, TRequestStatus& aStatus); +private: + RSsmStateAwareSession(const RSsmStateAwareSession& aState); + +private: + //The main reason for this class is to hide implementation details that might change + class RPrivateImpl; + RPrivateImpl* iPimpl; + }; + +/** +Interface to implement for clients that want to use the @c CSsmStateAwareSession +utility class. + +@publishedPartner +@released +*/ +class MStateChangeNotificationSubscriber + { +public: + /** + @c StateChanged is called when the System State have changed + @param aSsmState contains the new System State + @see TSsmMainSystemStates + */ + virtual void StateChanged(TSsmState aSsmState) = 0; + }; + +/** +Utility class for monitoring the System State. Maintains a list of +subscribers that share a single active object. When the System State +changes the subscribers will be notified in the order +they were added to the list of subscribers. + +@see TSsmMainSystemStates +@see RSsmStateAwareSession +@publishedPartner +@released +*/ +NONSHARABLE_CLASS(CSsmStateAwareSession) : public CBase + { +public: + IMPORT_C static CSsmStateAwareSession* NewL(TDmDomainId aId); + IMPORT_C static CSsmStateAwareSession* NewLC(TDmDomainId aId); + IMPORT_C ~CSsmStateAwareSession(); + IMPORT_C TSsmState State() const; + IMPORT_C void AddSubscriberL(MStateChangeNotificationSubscriber& aSubscriber); + IMPORT_C void RemoveSubscriber(const MStateChangeNotificationSubscriber& aSubscriber); + // for CSsmStateMonitor + void NotifySubscribers(TSsmState aNewState); + +private: + CSsmStateAwareSession(); + void ConstructL(TDmDomainId aId); + +private: + RPointerArray iSubscribers; // Elements of the array are not owned. + CSsmStateMonitor* iMonitor; + TInt iSpare[4]; + }; + +#endif