1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/domainmgr/inc/domainmanager.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,139 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +// WARNING: This file contains some APIs which are internal and are subject
1.19 +// to change without notice. Such APIs should therefore not be used
1.20 +// outside the Kernel and Hardware Services package.
1.21 +//
1.22 +
1.23 +#ifndef __DOMAIN_MANAGER_H__
1.24 +#define __DOMAIN_MANAGER_H__
1.25 +
1.26 +#include <e32std.h>
1.27 +
1.28 +#include <domaindefs.h>
1.29 +
1.30 +/**
1.31 +@internalComponent
1.32 +*/
1.33 +#define KDmManagerFileNameLit _L("domainSrv.exe")
1.34 +
1.35 +/**
1.36 +@internalComponent
1.37 +*/
1.38 +class RDmManagerSession : public RSessionBase
1.39 + {
1.40 +public:
1.41 + TInt Connect();
1.42 + TInt Connect(TDmHierarchyId aHierarchyId);
1.43 + TInt ConnectObserver(TDmHierarchyId aHierarchyId);
1.44 + void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
1.45 + void RequestDomainTransition(TDmDomainId, TDmDomainState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
1.46 + void CancelTransition();
1.47 + TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
1.48 + TInt GetTransitionFailureCount();
1.49 + TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
1.50 + // Observer related functions
1.51 + TInt StartObserver(TDmDomainId aDomainId,TDmNotifyType aNotifyType);
1.52 + void GetNotification(TRequestStatus& aStatus);
1.53 + TInt GetEventCount();
1.54 + TInt GetEvents(RArray<const TTransInfo>& aTransitions);
1.55 + void CancelObserver();
1.56 + TInt ObserverDomainCount();
1.57 + };
1.58 +
1.59 +
1.60 +/**
1.61 +@publishedPartner
1.62 +@released
1.63 +
1.64 +The policy's interface to the domain manager.
1.65 +*/
1.66 +class RDmDomainManager
1.67 + {
1.68 +public:
1.69 + IMPORT_C static TInt WaitForInitialization();
1.70 +public:
1.71 + IMPORT_C TInt Connect();
1.72 + IMPORT_C void Close();
1.73 +
1.74 + IMPORT_C void RequestSystemTransition(TPowerState aState, TRequestStatus& aStatus);
1.75 + IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TPowerState aState, TRequestStatus& aStatus);
1.76 + IMPORT_C void CancelTransition();
1.77 +
1.78 + IMPORT_C void SystemShutdown();
1.79 + /**
1.80 + @internalAll
1.81 + */
1.82 + IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId);
1.83 + /**
1.84 + @internalAll
1.85 + */
1.86 + IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
1.87 + /**
1.88 + @internalAll
1.89 + */
1.90 + IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
1.91 + /**
1.92 + @internalAll
1.93 + */
1.94 + IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
1.95 + /**
1.96 + @internalAll
1.97 + */
1.98 + IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
1.99 + /**
1.100 + @internalAll
1.101 + */
1.102 + IMPORT_C TInt GetTransitionFailureCount();
1.103 +private:
1.104 + RDmManagerSession iSession;
1.105 + };
1.106 +
1.107 +
1.108 +
1.109 +
1.110 +/**
1.111 +@internalComponent
1.112 +
1.113 +An abstract class to allow a domain controller to interface to the domain manager.
1.114 +
1.115 +To make use of this class an application must derive from it and implement a RunL()
1.116 +method to handle notifications.
1.117 +After the derived class has been instantiated, it must call ConstructL().
1.118 +*/
1.119 +class CDmDomainManager : public CActive
1.120 + {
1.121 +public:
1.122 + IMPORT_C CDmDomainManager(TDmHierarchyId aHierarchyId);
1.123 + IMPORT_C ~CDmDomainManager();
1.124 +
1.125 + IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection);
1.126 + IMPORT_C void RequestDomainTransition(TDmDomainId aDomainId, TDmDomainState aState, TDmTraverseDirection aDirection);
1.127 + IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
1.128 + IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
1.129 + IMPORT_C TInt GetTransitionFailureCount();
1.130 + virtual void RunL() = 0;
1.131 +protected:
1.132 + // from CActive
1.133 + IMPORT_C void DoCancel();
1.134 + IMPORT_C void ConstructL();
1.135 +
1.136 +private:
1.137 + RDmDomainManager iManager;
1.138 + TDmHierarchyId iHierarchyId;
1.139 + TInt iReserved[4];
1.140 + };
1.141 +
1.142 +#endif