|
1 /* |
|
2 * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of terminalsecurity components |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SCPLOCKSETTINGEVENTHANDLER_H |
|
20 #define SCPLOCKSETTINGEVENTHANDLER_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <bldvariant.hrh> |
|
25 #include "SCPLockEventHandler.h" |
|
26 #include "SCPServer.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CSCPSession; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * An active object class, which handles setting the phone lock |
|
35 */ |
|
36 class CSCPLockSettingEventHandler : public CSCPLockEventHandler |
|
37 { |
|
38 public: // Methods |
|
39 |
|
40 // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Static constructor. |
|
44 */ |
|
45 static CSCPLockSettingEventHandler* NewL( |
|
46 const RMessage2& aLockMessage, |
|
47 CSCPSession* aSession, |
|
48 TBool aState, |
|
49 TBool aAutolock, |
|
50 CSCPServer* aServer ); |
|
51 |
|
52 /** |
|
53 * Static constructor, that leaves the pointer to the cleanup stack. |
|
54 */ |
|
55 static CSCPLockSettingEventHandler* NewLC( |
|
56 const RMessage2& aLockMessage, |
|
57 CSCPSession* aSession, |
|
58 TBool aState, |
|
59 TBool aAutolock, |
|
60 CSCPServer* aServer ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CSCPLockSettingEventHandler(); |
|
66 |
|
67 // New methods |
|
68 /** |
|
69 * Informs the object that an acknowledgement was received |
|
70 * This method will be used, if the acknowledgement comes in |
|
71 * before the wait is started. |
|
72 */ |
|
73 void AckReceived(); |
|
74 |
|
75 /** |
|
76 * Starts the lock/unlock operation. Must be called for the object |
|
77 * to take any action. |
|
78 */ |
|
79 void StartL(); |
|
80 |
|
81 protected: // Methods |
|
82 |
|
83 // Methods from base classes |
|
84 |
|
85 /** |
|
86 * From CActive The active object working method. |
|
87 */ |
|
88 void RunL(); |
|
89 |
|
90 /** |
|
91 * From CActive The active object request cancellation method. |
|
92 */ |
|
93 void DoCancel(); |
|
94 |
|
95 private: //Methods |
|
96 |
|
97 /** |
|
98 * C++ default constructor. |
|
99 */ |
|
100 CSCPLockSettingEventHandler( |
|
101 const RMessage2& aLockMessage, |
|
102 CSCPSession* aSession, |
|
103 TBool aState, |
|
104 TBool aAutolock, |
|
105 CSCPServer* aServer ); |
|
106 |
|
107 /** |
|
108 * By default Symbian 2nd phase constructor is private. |
|
109 */ |
|
110 void ConstructL(); |
|
111 |
|
112 /** |
|
113 * Used to activate/deactivate Autolock |
|
114 */ |
|
115 void SetAutolockStateL( TBool aActive ); |
|
116 |
|
117 protected: // Data |
|
118 |
|
119 private: // Data |
|
120 /** The message which initiated this call, will be completed when finished */ |
|
121 const RMessage2 iLockMessage; |
|
122 /** The parent session pointer */ |
|
123 CSCPSession* iSession; |
|
124 /** The state to which the lock should be set */ |
|
125 TBool iState; |
|
126 /** Should Autolock be activated/deactivated on success */ |
|
127 TBool iAutolock; |
|
128 /** Is the AO waiting for an acknowledgement to the lock setting call*/ |
|
129 TBool iWaitingForAck; |
|
130 /** Has the AO received an acknowledgement already*/ |
|
131 TBool iAckReceived; |
|
132 /** Has an unlock-message to Autolock been sent*/ |
|
133 TBool iUnlockSent; |
|
134 /** The return status for the message*/ |
|
135 TInt iMessageStatus; |
|
136 }; |
|
137 |
|
138 #endif // SCPLOCKSETTINGEVENTHANDLER_H |
|
139 |
|
140 // End of File |
|
141 |