279
|
1 |
// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
|
0
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
279
|
14 |
// Contains the Domain Manager interface for clients acting in the role of
|
|
15 |
// "Domain Controller".
|
|
16 |
//
|
0
|
17 |
// WARNING: This file contains some APIs which are internal and are subject
|
|
18 |
// to change without notice. Such APIs should therefore not be used
|
|
19 |
// outside the Kernel and Hardware Services package.
|
|
20 |
//
|
|
21 |
|
|
22 |
#ifndef __DOMAIN_MANAGER_H__
|
|
23 |
#define __DOMAIN_MANAGER_H__
|
|
24 |
|
|
25 |
#include <e32std.h>
|
|
26 |
|
|
27 |
#include <domaindefs.h>
|
|
28 |
|
279
|
29 |
|
0
|
30 |
/**
|
279
|
31 |
Internal macro used by EStart source. It provides the filename of the Domain
|
|
32 |
Manager server.
|
|
33 |
Not to be used outside the KernelHwSrv package.
|
0
|
34 |
*/
|
|
35 |
#define KDmManagerFileNameLit _L("domainSrv.exe")
|
|
36 |
|
279
|
37 |
|
|
38 |
|
0
|
39 |
/**
|
279
|
40 |
Internal session class used inside the Domain Manager client library.
|
|
41 |
Not to be used outside the KernelHwSrv package.
|
0
|
42 |
*/
|
|
43 |
class RDmManagerSession : public RSessionBase
|
|
44 |
{
|
|
45 |
public:
|
279
|
46 |
// Power hierarchy connect
|
0
|
47 |
TInt Connect();
|
279
|
48 |
|
|
49 |
// Specified hierarchy connect
|
0
|
50 |
TInt Connect(TDmHierarchyId aHierarchyId);
|
|
51 |
TInt ConnectObserver(TDmHierarchyId aHierarchyId);
|
279
|
52 |
|
|
53 |
// Controller related functions
|
0
|
54 |
void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
|
|
55 |
void RequestDomainTransition(TDmDomainId, TDmDomainState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
|
|
56 |
void CancelTransition();
|
|
57 |
TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
|
|
58 |
TInt GetTransitionFailureCount();
|
|
59 |
TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
|
279
|
60 |
|
0
|
61 |
// Observer related functions
|
|
62 |
TInt StartObserver(TDmDomainId aDomainId,TDmNotifyType aNotifyType);
|
|
63 |
void GetNotification(TRequestStatus& aStatus);
|
|
64 |
TInt GetEventCount();
|
|
65 |
TInt GetEvents(RArray<const TTransInfo>& aTransitions);
|
|
66 |
void CancelObserver();
|
|
67 |
TInt ObserverDomainCount();
|
|
68 |
};
|
|
69 |
|
|
70 |
|
|
71 |
/**
|
279
|
72 |
Published platform interface of the Domain Manager for clients performing
|
|
73 |
the "Domain Controller" role implementing domain policy on the platform.
|
|
74 |
|
|
75 |
Controllers can use this class to request domain state transitions either
|
|
76 |
system-wide across the whole domain hierarchy or only within a specific domain
|
|
77 |
subtree.
|
0
|
78 |
|
279
|
79 |
The Domain Manager may utilize the Transition Monitoring feature for some state
|
|
80 |
transitions (as defined in the policy) which allows trusted clients to request
|
|
81 |
more time to complete their work for the transition e.g. power down transitions.
|
|
82 |
|
|
83 |
It also provides utility methods allowing policy controllers to load additional
|
|
84 |
hierarchies (from a domain policy library) and to monitor the Domain Manager's
|
|
85 |
start-up.
|
|
86 |
|
|
87 |
See the RDmDomain class for the interface used by Domain Member clients.
|
|
88 |
|
|
89 |
Also see domaindefs.h for Domain Manager specific error codes used with this
|
|
90 |
API.
|
0
|
91 |
*/
|
|
92 |
class RDmDomainManager
|
|
93 |
{
|
|
94 |
public:
|
|
95 |
IMPORT_C static TInt WaitForInitialization();
|
279
|
96 |
|
0
|
97 |
public:
|
279
|
98 |
// Power Hierarchy
|
0
|
99 |
IMPORT_C TInt Connect();
|
|
100 |
IMPORT_C void RequestSystemTransition(TPowerState aState, TRequestStatus& aStatus);
|
|
101 |
IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TPowerState aState, TRequestStatus& aStatus);
|
279
|
102 |
IMPORT_C void SystemShutdown();
|
0
|
103 |
|
279
|
104 |
// Controller Specified Hierarchy
|
|
105 |
IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
|
0
|
106 |
IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId);
|
|
107 |
IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
|
|
108 |
IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
|
279
|
109 |
|
|
110 |
// Common session/hierarchy
|
0
|
111 |
IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
|
|
112 |
IMPORT_C TInt GetTransitionFailureCount();
|
279
|
113 |
IMPORT_C void CancelTransition();
|
|
114 |
IMPORT_C void Close();
|
|
115 |
|
0
|
116 |
private:
|
|
117 |
RDmManagerSession iSession;
|
|
118 |
};
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
#endif
|