sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without notice. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: #ifndef __DOMAIN_DEFS_H__ sl@0: #define __DOMAIN_DEFS_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: @internalTechnology sl@0: */ sl@0: // Property category UID value reserved for Domain Management services. sl@0: // This is the same as the process SID (see domainsrv.mmp) sl@0: static const TInt32 KUidDmPropertyCategoryValue = 0x1020E406; sl@0: /** sl@0: @internalTechnology sl@0: */ sl@0: // Property category UID reserved for Domain Management services sl@0: static const TUid KUidDmPropertyCategory = { KUidDmPropertyCategoryValue }; sl@0: /** sl@0: @internalTechnology sl@0: */ sl@0: static const TUint KDmPropertyKeyInit = 0x00000001; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: Defines the ways in which a domain hierarchy can be traversed. sl@0: sl@0: @see CDmDomainManager::RequestSystemTransition() sl@0: @see CDmDomainManager::RequestDomainTransition() sl@0: */ sl@0: enum TDmTraverseDirection sl@0: { sl@0: /** sl@0: Transition parents first (i.e. before their children). sl@0: */ sl@0: ETraverseParentsFirst, sl@0: sl@0: /** sl@0: Transition children first (i.e. before their parents). sl@0: */ sl@0: ETraverseChildrenFirst, sl@0: sl@0: /** sl@0: Use the default direction specified in policy sl@0: */ sl@0: ETraverseDefault, sl@0: sl@0: /** sl@0: Maximum value for traverse mode sl@0: */ sl@0: ETraverseMax = ETraverseDefault sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: Defines the type of transitions that will be notified to the observer. sl@0: sl@0: One of these values is specified when the observer is started through a sl@0: call to CHierarchyObserver::StartObserver(). sl@0: */ sl@0: enum TDmNotifyType sl@0: { sl@0: /** sl@0: Notifies the observer about all transition requests. sl@0: */ sl@0: EDmNotifyTransRequest =0x02, sl@0: sl@0: /** sl@0: Notifies the observer about successful transitions only. sl@0: */ sl@0: EDmNotifyPass =0x04, sl@0: sl@0: /** sl@0: Notifies the observer about failing transitions only. sl@0: */ sl@0: EDmNotifyFail=0x08, sl@0: sl@0: /** sl@0: Notifies the observer about all completed transitions. sl@0: */ sl@0: EDmNotifyTransOnly=EDmNotifyPass|EDmNotifyFail, sl@0: sl@0: /** sl@0: Notifies the observer about successful transitions and transition requests. sl@0: */ sl@0: EDmNotifyReqNPass=EDmNotifyTransRequest|EDmNotifyPass, sl@0: sl@0: /** sl@0: Notifies the observer about failed transitions and transition requests. sl@0: */ sl@0: EDmNotifyReqNFail=EDmNotifyTransRequest|EDmNotifyFail, sl@0: sl@0: /** sl@0: Notifies the observer about every event. sl@0: */ sl@0: EDmNotifyAll=EDmNotifyTransRequest|EDmNotifyFail|EDmNotifyPass, sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: Domain hierarchy identifier type. sl@0: sl@0: Domain hierarchies are designated by "well known" domain hierarchy identifiers. sl@0: The domain policy statically defines the list of domain hierarchies and their sl@0: identifiers. sl@0: sl@0: @see RDmDomainManager::Connect() sl@0: @see RDmDomainManager::AddDomainHierarchy() sl@0: @see RDmDomain::Connect() sl@0: @see CHierarchyObserver sl@0: @see CDmDomainManager sl@0: @see CDmDomain sl@0: */ sl@0: typedef TUint8 TDmHierarchyId; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: A type used to describe the state of a domain. sl@0: */ sl@0: typedef TUint TDmDomainState; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalTechnology sl@0: sl@0: The power domain hierarchy Id. sl@0: */ sl@0: static const TDmHierarchyId KDmHierarchyIdPower = 1; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: The start-up domain hierarchy Id. sl@0: */ sl@0: static const TDmHierarchyId KDmHierarchyIdStartup = 2; sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: The start-up domain hierarchy Id. (For use by domain manager and/or SSMA) sl@0: */ sl@0: static const TDmHierarchyId KDmHierarchyIdSystemState = KDmHierarchyIdStartup; sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Domain identifier type. sl@0: sl@0: Domains are designated by "well known" domain identifiers. sl@0: The domain manager statically defines the list of domains and their identifiers. sl@0: */ sl@0: typedef TUint16 TDmDomainId; sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: A structure use to describe a transition failure. sl@0: */ sl@0: class TTransitionFailure sl@0: { sl@0: public: sl@0: inline TTransitionFailure() {}; sl@0: TTransitionFailure( TDmDomainId aDomainId, TInt aError); sl@0: sl@0: public: sl@0: /** sl@0: Id of the domain of interest sl@0: */ sl@0: TDmDomainId iDomainId; sl@0: /** sl@0: error code in transition sl@0: */ sl@0: TInt iError; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: @internalTechnology sl@0: sl@0: A structure use to describe a successful transition. sl@0: */ sl@0: class TTransInfo sl@0: { sl@0: public: sl@0: inline TTransInfo() {}; sl@0: TTransInfo( TDmDomainId aDomainId, TDmDomainState aState, TInt aError); sl@0: sl@0: public: sl@0: /** sl@0: Id of the domain of interest sl@0: */ sl@0: TDmDomainId iDomainId; sl@0: /** sl@0: Final state of the domain after the transition sl@0: */ sl@0: TDmDomainState iState; sl@0: /** sl@0: Any error in transition sl@0: */ sl@0: TInt iError; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: The null domain identifier. sl@0: sl@0: There are no domains with this identifier. sl@0: */ sl@0: static const TDmDomainId KDmIdNone = 0x00; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: The common ancestor of all domains. sl@0: */ sl@0: static const TDmDomainId KDmIdRoot = 0x01; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: The usual domain for all non-UI applications. sl@0: */ sl@0: static const TDmDomainId KDmIdApps = 0x02; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: The usual domain for all UI applications. sl@0: */ sl@0: static const TDmDomainId KDmIdUiApps = 0x03; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Domain manager specific error code - the domain designated by sl@0: the specified domain identifier does not exist. sl@0: */ sl@0: static const TInt KDmErrBadDomainId = -256; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Domain manager specific error code - this RDmDomain object has already been sl@0: connected to a domain. sl@0: */ sl@0: static const TInt KDmErrAlreadyJoin = -257; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Domain manager specific error code - this RDmDomain object is not connected sl@0: to any domain. sl@0: */ sl@0: static const TInt KDmErrNotJoin = -258; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Domain manager specific error code - indicates a client-server protocol internal error. sl@0: */ sl@0: static const TInt KDmErrBadRequest = -259; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Domain manager specific error code - indicates an internal Domain Manager error. sl@0: */ sl@0: static const TInt KDmErrBadDomainSpec = -260; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Domain manager specific error code - indicates a bad sequence of requests. sl@0: sl@0: Typically, this occurs when a new request been made while an ongoing domain sl@0: transition request has not yet completed. sl@0: */ sl@0: static const TInt KDmErrBadSequence = -261; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalTechnology sl@0: sl@0: Domain manager specific error code - indicates that a transition is outstanding. sl@0: sl@0: */ sl@0: static const TInt KDmErrOutstanding = -262; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: Domain manager specific error code - indicates that the domain hierarchy does not exist. sl@0: */ sl@0: static const TInt KErrBadHierarchyId = -263; sl@0: sl@0: #endif sl@0: