|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Notifier class for Security code dialogs. Notifier calls appropriate |
|
16 * dialog to be opened from SecUi. |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef __SECURITYNOTIFIER_H |
|
21 #define __SECURITYNOTIFIER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <e32base.h> |
|
26 #include <eiknotapi.h> |
|
27 #include <etelmm.h> |
|
28 #include <securitynotification.h> |
|
29 |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 const TUid KSecurityNotifierChannel = {0x1000598F}; |
|
34 const TUid KSecurityNotifierAppServerUid = {0x102071FB}; |
|
35 |
|
36 IMPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray(); // Notifier array (entry point) |
|
37 |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * CSecurityNotifier class |
|
43 * |
|
44 * |
|
45 */ |
|
46 class CSecurityNotifier : public CActive,public MEikSrvNotifierBase2 |
|
47 { |
|
48 public: |
|
49 /** |
|
50 * Creates instance of the CSecurityNotifier class. |
|
51 * |
|
52 * @return Returns the MEikSrvNotifierBase2 instance just created. |
|
53 */ |
|
54 static MEikSrvNotifierBase2* NewL(); |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~CSecurityNotifier(); |
|
59 public: // from MEikSrvNotifierBase2 |
|
60 /** |
|
61 * Called when all resources allocated by notifiers should be freed. |
|
62 */ |
|
63 void Release(); |
|
64 /** |
|
65 * From MEikSrvNotifierBase2 - method for registering the EikSrv plugin |
|
66 * |
|
67 * @return TNotifierInfo - struct containing the plugin priorities etc. |
|
68 */ |
|
69 TNotifierInfo RegisterL(); |
|
70 /** |
|
71 * From MEikSrvNotifierBase2 - method for getting the notifier info |
|
72 * |
|
73 * @return TNotifierInfo - struct containing the plugin priorities etc. |
|
74 */ |
|
75 TNotifierInfo Info() const; |
|
76 /** |
|
77 * From MEikSrvNotifierBase2 - method for starting the plugin. Synchronous version |
|
78 * @param aBuffer - buffer containing the parameters for the plugin, packaged in TPckg<SAknSoftNotificationParams> |
|
79 * @return TPtrC8 - return value to the client, this method will return KNullDesC |
|
80 */ |
|
81 TPtrC8 StartL(const TDesC8& aBuffer); |
|
82 /** |
|
83 * From MEikSrvNotifierBase2 - method for starting the plugin. Asynchronous version. |
|
84 * @param aBuffer - buffer containing parameters for the plugin, packaged in TPckg<SAknSoftNotificationParams> |
|
85 * @param aReturnVal - return value of any type. Not used in this case. |
|
86 * @param aMessage - RMessage to notify that the execution has ended |
|
87 */ |
|
88 void StartL(const TDesC8& aBuffer,TInt aReturnVal, const RMessagePtr2& aMessage); |
|
89 /** |
|
90 * From MEikSrvNotifierBase2 - method for cancelling the plugin execution. |
|
91 */ |
|
92 void Cancel(); |
|
93 /** |
|
94 * From MEikSrvNotifierBase2 - method for updating the plugin while execution is in progress |
|
95 * @param aBuffer - buffer containing parameters for the plugin, packaged in TPckg<SAknSoftNotificationParams> |
|
96 * @return not used, return KNullDesC |
|
97 */ |
|
98 TPtrC8 UpdateL(const TDesC8& /*aBuffer*/); |
|
99 public: // From CActive |
|
100 /** @see CActive::RunL() */ |
|
101 void RunL(); |
|
102 /** @see CActive::DoCancel() */ |
|
103 void DoCancel(); |
|
104 private: |
|
105 /** |
|
106 * C++ default constructor. |
|
107 */ |
|
108 CSecurityNotifier(); |
|
109 /** |
|
110 * Initialize parameters and jumps to RunL |
|
111 * @param aBuffer - buffer containing parameters for the plugin, packaged in TPckg<SAknSoftNotificationParams> |
|
112 * @param aReturnVal - return value of any type. Not used in this case. |
|
113 * @param aMessage - RMessage to notify that the execution has ended |
|
114 */ |
|
115 void GetParamsL(const TDesC8& aBuffer, TInt aReturnVal, const RMessagePtr2& aMessage); |
|
116 private: // data |
|
117 TNotifierInfo iInfo; |
|
118 /***************************************************** |
|
119 * Series 60 Customer / ETel |
|
120 * Series 60 ETel API |
|
121 *****************************************************/ |
|
122 RTelServer iServer; |
|
123 RMobilePhone iPhone; |
|
124 RMobilePhone::TMobilePhoneSecurityEvent iEvent; |
|
125 protected: |
|
126 RMessagePtr2 iMessage; // Received message |
|
127 TInt iReturnVal; // Return value |
|
128 TBool iStartup; // System state: true means we are in the middle of a boot. |
|
129 }; |
|
130 |
|
131 #endif |
|
132 |
|
133 // end of file |