|
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 |
|
17 |
|
18 #ifndef __SSMSWPPOLICYFRAME_H__ |
|
19 #define __SSMSWPPOLICYFRAME_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <ssm/ssmswppolicy.h> |
|
23 #include <ssm/ssmswp.h> |
|
24 #include "ssmswppolicycli.h" |
|
25 #include "ssmswppolicyproxy.h" |
|
26 |
|
27 class CSsmCommandList; |
|
28 |
|
29 /** |
|
30 The CSsmSwpPolicyFrame class is responsible for loading and discarding the policy DLL. |
|
31 It provides accessor functions that call policy functions through the swp policy interface. |
|
32 The CSsmSwpPolicyFrame also takes ownership of the RLibrary class that was used to load the DLL |
|
33 in order to discard the DLL when deleted |
|
34 |
|
35 @internalComponent |
|
36 @released |
|
37 */ |
|
38 class CSsmSwpPolicyFrame : public CBase |
|
39 { |
|
40 public: |
|
41 static CSsmSwpPolicyFrame* NewL(TLibraryFunction aNewLFunc); |
|
42 ~CSsmSwpPolicyFrame(); |
|
43 |
|
44 TUint SwpKey() const; |
|
45 void SetSwpKey(TUint aSwpKey); |
|
46 void SetLibrary(const RLibrary& aLibrary); |
|
47 void SetSsmSwpPolicySession(CSsmSwpPolicyCliSession* aSsmSwpPolicySession); |
|
48 |
|
49 void CallInitialize(TRequestStatus& aStatus); |
|
50 TInt CallInitializeCancel(); |
|
51 MSsmSwpPolicy::TResponse CallTransitionAllowed(const TSsmSwp& aSwp, const RMessagePtr2& aMessage); |
|
52 void CallPrepareCommandList(const TSsmSwp& aSwp, TRequestStatus& aStatus); |
|
53 TInt CallPrepareCommandListCancel(); |
|
54 CSsmCommandList* CallCommandList(); |
|
55 void CallHandleCleReturnValue(const TSsmSwp& aSwp, TInt aError, TInt aSeverity, TRequestStatus& aStatus); |
|
56 TInt CallHandleCleReturnValueCancel(); |
|
57 |
|
58 private: |
|
59 CSsmSwpPolicyFrame(); |
|
60 void ConstructL(TLibraryFunction aNewLFunc); |
|
61 |
|
62 private: |
|
63 enum TInternalStates |
|
64 { |
|
65 EWaitForInitialize, |
|
66 EWaitForPrepare, |
|
67 EWaitForGet, |
|
68 EWaitForCommandListExecution |
|
69 }; |
|
70 /** used to track the internal state of the object for extra integrity */ |
|
71 TInternalStates iInternalState; |
|
72 /** the policy that has been loaded */ |
|
73 MSsmSwpPolicy* iSwpPolicy; |
|
74 /** the swp key that this object represents */ |
|
75 TUint iSwpKey; |
|
76 /** track whether the object has been initialised */ |
|
77 TBool iInitializeCalled; |
|
78 /** the library object used to load the DLL */ |
|
79 RLibrary iLibrary; |
|
80 /** the interface used to communicate with the SsmSwpPolicyServer */ |
|
81 CSsmSwpPolicyCliSession* iSsmSwpPolicySession; //not owned by me |
|
82 }; |
|
83 |
|
84 #endif |