|
1 // Copyright (c) 2007-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 "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 |
|
16 #ifndef __SSMSWPPOLICY_H__ |
|
17 #define __SSMSWPPOLICY_H__ |
|
18 |
|
19 #include <e32cmn.h> |
|
20 |
|
21 class CSsmCommandList; |
|
22 class TSsmSwp; |
|
23 |
|
24 /** |
|
25 The 2'nd UID value for System Wide Property policy DLLs. |
|
26 @publishedPartner |
|
27 @released |
|
28 */ |
|
29 const TInt KSsmSwpPolicyDllTypeUidValue=0x2000D765; |
|
30 |
|
31 /** |
|
32 The 2'nd UID for System Wide Property policy DLLs. |
|
33 @publishedPartner |
|
34 @released |
|
35 */ |
|
36 const TUid KSsmSwpPolicyDllTypeUid={KSsmSwpPolicyDllTypeUidValue}; |
|
37 |
|
38 /** |
|
39 The protocol for System Wide Property policy DLLs. |
|
40 These are not ECOM DLLs because they need to work before the ECOM server is started. |
|
41 These DLLs can only be loaded from the ROM file system (from Z:). |
|
42 @publishedPartner |
|
43 @released |
|
44 */ |
|
45 class MSsmSwpPolicy |
|
46 { |
|
47 public: |
|
48 |
|
49 enum TResponse |
|
50 { |
|
51 /* The requested system value is not permissible */ |
|
52 ENotAllowed, |
|
53 |
|
54 /* Value ok */ |
|
55 EAllowed |
|
56 }; |
|
57 |
|
58 /** |
|
59 Used to determine if an incoming request should be accepted or rejected. |
|
60 @param aSwp Contains information about the new request. |
|
61 @param aMessage Contains information about the requesting client process. DLLs should not call RMessagePtr2::Complete. |
|
62 @return The decision from the the virtual implementation |
|
63 */ |
|
64 virtual TResponse TransitionAllowed(const TSsmSwp& aSwp, const RMessagePtr2& aMessage) = 0; |
|
65 |
|
66 /** |
|
67 This function is guaranteed to be called before this Swp Policy is used. |
|
68 It is intended for e.g. opening resource files, initialize hardware or |
|
69 talk to a domestic OS. |
|
70 @code |
|
71 //minimal implemementation of this function would be |
|
72 TRequestStatus* status = &aStatus; |
|
73 User::RequestComplete(status, KErrNone); |
|
74 @endcode |
|
75 @param aStatus to complete when the initialization operation has finished |
|
76 */ |
|
77 virtual void Initialize(TRequestStatus& aStatus) = 0; |
|
78 |
|
79 /** |
|
80 Used to inform the DLL to Cancel the pending asynchronous Initialize operation. |
|
81 */ |
|
82 virtual void InitializeCancel() = 0; |
|
83 |
|
84 /** |
|
85 Used to create the command list associated with a Swp change. |
|
86 @param aSwp Contains the key that identifies the command list to create. Also |
|
87 contains the new value to be set to the Swp in question. |
|
88 @param aStatus Used to signify command list is prepared |
|
89 */ |
|
90 virtual void PrepareCommandList(const TSsmSwp& aSwp, TRequestStatus& aStatus) = 0; |
|
91 |
|
92 /** |
|
93 Used to inform the DLL to Cancel the pending asynchronous PrepareCommandList operation. |
|
94 */ |
|
95 virtual void PrepareCommandListCancel() = 0; |
|
96 |
|
97 /** |
|
98 Used to retrieve the command list once the PrepareCommandList has completed. |
|
99 Ownership of the returned command list is transferred to the caller. |
|
100 @return The command list created during the preceding PrepareCommandList step |
|
101 */ |
|
102 virtual CSsmCommandList* CommandList() = 0; |
|
103 |
|
104 /** |
|
105 Handle the return value from the CLE. This gives the policy a chance to do some |
|
106 Error handling, in case execution of the command list should fail in any way. |
|
107 @param aSwp Contains information about the request that has been executed |
|
108 @param aError Contains the error-code that resulted from the Command-list execution |
|
109 @param aSeverity Contains the severity of the failed command in case the Command-list execution ended with an error |
|
110 @param aStatus to complete when aError has been dealt with |
|
111 */ |
|
112 virtual void HandleCleReturnValue(const TSsmSwp& aSwp, TInt aError, TInt aSeverity, TRequestStatus& aStatus) = 0; |
|
113 |
|
114 /** |
|
115 Used to inform the DLL to Cancel the pending asynchronous HandleCleReturnValue operation. |
|
116 */ |
|
117 virtual void HandleCleReturnValueCancel() = 0; |
|
118 |
|
119 /** |
|
120 It is expected that Release will usually just call "delete this" on the object, |
|
121 but this will depend on the implementation of each policy. |
|
122 */ |
|
123 virtual void Release() = 0; |
|
124 |
|
125 private: |
|
126 //for future use |
|
127 virtual void MSsmSwpPolicy_Reserved_1() {} |
|
128 virtual void MSsmSwpPolicy_Reserved_2() {} |
|
129 virtual void MSsmSwpPolicy_Reserved_3() {} |
|
130 }; |
|
131 |
|
132 #endif |