|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
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: |
|
14 // |
|
15 // WARNING: This file contains some APIs which are internal and are subject |
|
16 // to change without notice. Such APIs should therefore not be used |
|
17 // outside the Kernel and Hardware Services package. |
|
18 // |
|
19 |
|
20 #ifndef __DOMAIN_MANAGER_H__ |
|
21 #define __DOMAIN_MANAGER_H__ |
|
22 |
|
23 #include <e32std.h> |
|
24 |
|
25 #include <domaindefs.h> |
|
26 |
|
27 /** |
|
28 @internalComponent |
|
29 */ |
|
30 #define KDmManagerFileNameLit _L("domainSrv.exe") |
|
31 |
|
32 /** |
|
33 @internalComponent |
|
34 */ |
|
35 class RDmManagerSession : public RSessionBase |
|
36 { |
|
37 public: |
|
38 TInt Connect(); |
|
39 TInt Connect(TDmHierarchyId aHierarchyId); |
|
40 TInt ConnectObserver(TDmHierarchyId aHierarchyId); |
|
41 void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
|
42 void RequestDomainTransition(TDmDomainId, TDmDomainState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
|
43 void CancelTransition(); |
|
44 TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); |
|
45 TInt GetTransitionFailureCount(); |
|
46 TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures); |
|
47 // Observer related functions |
|
48 TInt StartObserver(TDmDomainId aDomainId,TDmNotifyType aNotifyType); |
|
49 void GetNotification(TRequestStatus& aStatus); |
|
50 TInt GetEventCount(); |
|
51 TInt GetEvents(RArray<const TTransInfo>& aTransitions); |
|
52 void CancelObserver(); |
|
53 TInt ObserverDomainCount(); |
|
54 }; |
|
55 |
|
56 |
|
57 /** |
|
58 @publishedPartner |
|
59 @released |
|
60 |
|
61 The policy's interface to the domain manager. |
|
62 */ |
|
63 class RDmDomainManager |
|
64 { |
|
65 public: |
|
66 IMPORT_C static TInt WaitForInitialization(); |
|
67 public: |
|
68 IMPORT_C TInt Connect(); |
|
69 IMPORT_C void Close(); |
|
70 |
|
71 IMPORT_C void RequestSystemTransition(TPowerState aState, TRequestStatus& aStatus); |
|
72 IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TPowerState aState, TRequestStatus& aStatus); |
|
73 IMPORT_C void CancelTransition(); |
|
74 |
|
75 IMPORT_C void SystemShutdown(); |
|
76 /** |
|
77 @internalAll |
|
78 */ |
|
79 IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId); |
|
80 /** |
|
81 @internalAll |
|
82 */ |
|
83 IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
|
84 /** |
|
85 @internalAll |
|
86 */ |
|
87 IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
|
88 /** |
|
89 @internalAll |
|
90 */ |
|
91 IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); |
|
92 /** |
|
93 @internalAll |
|
94 */ |
|
95 IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures); |
|
96 /** |
|
97 @internalAll |
|
98 */ |
|
99 IMPORT_C TInt GetTransitionFailureCount(); |
|
100 private: |
|
101 RDmManagerSession iSession; |
|
102 }; |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 /** |
|
108 @internalComponent |
|
109 |
|
110 An abstract class to allow a domain controller to interface to the domain manager. |
|
111 |
|
112 To make use of this class an application must derive from it and implement a RunL() |
|
113 method to handle notifications. |
|
114 After the derived class has been instantiated, it must call ConstructL(). |
|
115 */ |
|
116 class CDmDomainManager : public CActive |
|
117 { |
|
118 public: |
|
119 IMPORT_C CDmDomainManager(TDmHierarchyId aHierarchyId); |
|
120 IMPORT_C ~CDmDomainManager(); |
|
121 |
|
122 IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection); |
|
123 IMPORT_C void RequestDomainTransition(TDmDomainId aDomainId, TDmDomainState aState, TDmTraverseDirection aDirection); |
|
124 IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); |
|
125 IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures); |
|
126 IMPORT_C TInt GetTransitionFailureCount(); |
|
127 virtual void RunL() = 0; |
|
128 protected: |
|
129 // from CActive |
|
130 IMPORT_C void DoCancel(); |
|
131 IMPORT_C void ConstructL(); |
|
132 |
|
133 private: |
|
134 RDmDomainManager iManager; |
|
135 TDmHierarchyId iHierarchyId; |
|
136 TInt iReserved[4]; |
|
137 }; |
|
138 |
|
139 #endif |