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_MANAGER_H__ sl@0: #define __DOMAIN_MANAGER_H__ sl@0: sl@0: #include sl@0: sl@0: #include sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: #define KDmManagerFileNameLit _L("domainSrv.exe") sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: class RDmManagerSession : public RSessionBase sl@0: { sl@0: public: sl@0: TInt Connect(); sl@0: TInt Connect(TDmHierarchyId aHierarchyId); sl@0: TInt ConnectObserver(TDmHierarchyId aHierarchyId); sl@0: void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); sl@0: void RequestDomainTransition(TDmDomainId, TDmDomainState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); sl@0: void CancelTransition(); sl@0: TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); sl@0: TInt GetTransitionFailureCount(); sl@0: TInt GetTransitionFailures(RArray& aTransitionFailures); sl@0: // Observer related functions sl@0: TInt StartObserver(TDmDomainId aDomainId,TDmNotifyType aNotifyType); sl@0: void GetNotification(TRequestStatus& aStatus); sl@0: TInt GetEventCount(); sl@0: TInt GetEvents(RArray& aTransitions); sl@0: void CancelObserver(); sl@0: TInt ObserverDomainCount(); sl@0: }; sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: The policy's interface to the domain manager. sl@0: */ sl@0: class RDmDomainManager sl@0: { sl@0: public: sl@0: IMPORT_C static TInt WaitForInitialization(); sl@0: public: sl@0: IMPORT_C TInt Connect(); sl@0: IMPORT_C void Close(); sl@0: sl@0: IMPORT_C void RequestSystemTransition(TPowerState aState, TRequestStatus& aStatus); sl@0: IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TPowerState aState, TRequestStatus& aStatus); sl@0: IMPORT_C void CancelTransition(); sl@0: sl@0: IMPORT_C void SystemShutdown(); sl@0: /** sl@0: @internalAll sl@0: */ sl@0: IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId); sl@0: /** sl@0: @internalAll sl@0: */ sl@0: IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); sl@0: /** sl@0: @internalAll sl@0: */ sl@0: IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); sl@0: /** sl@0: @internalAll sl@0: */ sl@0: IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); sl@0: /** sl@0: @internalAll sl@0: */ sl@0: IMPORT_C TInt GetTransitionFailures(RArray& aTransitionFailures); sl@0: /** sl@0: @internalAll sl@0: */ sl@0: IMPORT_C TInt GetTransitionFailureCount(); sl@0: private: sl@0: RDmManagerSession iSession; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalComponent sl@0: sl@0: An abstract class to allow a domain controller to interface to the domain manager. sl@0: sl@0: To make use of this class an application must derive from it and implement a RunL() sl@0: method to handle notifications. sl@0: After the derived class has been instantiated, it must call ConstructL(). sl@0: */ sl@0: class CDmDomainManager : public CActive sl@0: { sl@0: public: sl@0: IMPORT_C CDmDomainManager(TDmHierarchyId aHierarchyId); sl@0: IMPORT_C ~CDmDomainManager(); sl@0: sl@0: IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection); sl@0: IMPORT_C void RequestDomainTransition(TDmDomainId aDomainId, TDmDomainState aState, TDmTraverseDirection aDirection); sl@0: IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); sl@0: IMPORT_C TInt GetTransitionFailures(RArray& aTransitionFailures); sl@0: IMPORT_C TInt GetTransitionFailureCount(); sl@0: virtual void RunL() = 0; sl@0: protected: sl@0: // from CActive sl@0: IMPORT_C void DoCancel(); sl@0: IMPORT_C void ConstructL(); sl@0: sl@0: private: sl@0: RDmDomainManager iManager; sl@0: TDmHierarchyId iHierarchyId; sl@0: TInt iReserved[4]; sl@0: }; sl@0: sl@0: #endif