|
1 /* |
|
2 * Copyright (c) 2008 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: ECom plugin install/uninstall/version listener |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CHFPATECOMLISTEN_H |
|
20 #define C_CHFPATECOMLISTEN_H |
|
21 |
|
22 #include <atext.h> |
|
23 #include <atextpluginbase.h> |
|
24 |
|
25 |
|
26 /** |
|
27 * Notification interface class for ECOM plugin interface status changes |
|
28 * |
|
29 * @lib HFPatext.lib |
|
30 * @since S60 v5.0 |
|
31 */ |
|
32 |
|
33 enum THFPState |
|
34 { |
|
35 EHFPStateIdle, |
|
36 EHFPStateAtCmdHandling, // ATEXT state for AT command handling |
|
37 EHFPStateAtUrcHandling, // ATEXT state for URC handling |
|
38 EHFPStateEcomListening // ATEXT state for ECOM change listening |
|
39 }; |
|
40 |
|
41 NONSHARABLE_CLASS( MHFPAtEcomListen ) |
|
42 { |
|
43 |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Notifies about new plugin installation |
|
48 * |
|
49 * @since S60 5.0 |
|
50 * @param aPluginUid UID of installed plugin |
|
51 * @return Symbian error code on error, KErrNone otherwise |
|
52 */ |
|
53 virtual TInt NotifyPluginInstallation( TUid& aPluginUid ) = 0; |
|
54 |
|
55 /** |
|
56 * Notifies about existing plugin uninstallation |
|
57 * |
|
58 * @since S60 5.0 |
|
59 * @param aPluginUid UID of uninstalled plugin |
|
60 * @return Symbian error code on error, KErrNone otherwise |
|
61 */ |
|
62 virtual TInt NotifyPluginUninstallation( TUid& aPluginUid ) = 0; |
|
63 |
|
64 }; |
|
65 |
|
66 /** |
|
67 * Class for ECom plugin install/uninstall/version listener |
|
68 * |
|
69 * @lib HFPatext.lib |
|
70 * @since S60 v5.0 |
|
71 */ |
|
72 NONSHARABLE_CLASS( CHFPAtEcomListen ) : public CActive |
|
73 { |
|
74 |
|
75 public: |
|
76 |
|
77 /** |
|
78 * Two-phased constructor. |
|
79 * @param aAtCmdExt Pointer to AT command extension |
|
80 * @param aCallback Callback to mode status change |
|
81 * @return Instance of self |
|
82 */ |
|
83 static CHFPAtEcomListen* NewL( RATExt* aAtCmdExt, |
|
84 MHFPAtEcomListen* aCallback ); |
|
85 |
|
86 /** |
|
87 * Two-phased constructor. |
|
88 * @param aAtCmdExt Pointer to AT command extension |
|
89 * @param aCallback Callback to mode status change |
|
90 * @return Instance of self |
|
91 */ |
|
92 static CHFPAtEcomListen* NewLC( RATExt* aAtCmdExt, |
|
93 MHFPAtEcomListen* aCallback ); |
|
94 |
|
95 /** |
|
96 * Destructor. |
|
97 */ |
|
98 virtual ~CHFPAtEcomListen(); |
|
99 |
|
100 /** |
|
101 * Resets data to initial values |
|
102 * |
|
103 * @since S60 5.0 |
|
104 * @return None |
|
105 */ |
|
106 void ResetData(); |
|
107 |
|
108 /** |
|
109 * Starts waiting for ECom plugin install/uninstall/version status changes |
|
110 * |
|
111 * @since S60 5.0 |
|
112 * @return Symbian error code on error, KErrNone otherwise |
|
113 */ |
|
114 TInt IssueRequest(); |
|
115 |
|
116 /** |
|
117 * Stops waiting for Ecom plugin install/uninstall/version status changes |
|
118 * |
|
119 * @since S60 5.0 |
|
120 * @return Symbian error code on error, KErrNone otherwise |
|
121 */ |
|
122 TInt Stop(); |
|
123 |
|
124 private: |
|
125 |
|
126 CHFPAtEcomListen( RATExt* aAtCmdExt, |
|
127 MHFPAtEcomListen* aCallback ); |
|
128 |
|
129 void ConstructL(); |
|
130 |
|
131 /** |
|
132 * Initializes this class |
|
133 * |
|
134 * @since S60 5.0 |
|
135 * @return None |
|
136 */ |
|
137 void Initialize(); |
|
138 |
|
139 // from base class CActive |
|
140 |
|
141 /** |
|
142 * From CActive. |
|
143 * Gets called when plugin installed, uninstalled or changed |
|
144 * |
|
145 * @since S60 5.0 |
|
146 * @return None |
|
147 */ |
|
148 void RunL(); |
|
149 |
|
150 /** |
|
151 * From CActive. |
|
152 * Gets called on cancel |
|
153 * |
|
154 * @since S60 5.0 |
|
155 * @return None |
|
156 */ |
|
157 void DoCancel(); |
|
158 |
|
159 private: // data |
|
160 |
|
161 /** |
|
162 * AT command extension |
|
163 * Not own. |
|
164 */ |
|
165 RATExt* iAtCmdExt; |
|
166 |
|
167 /** |
|
168 * Callback to call when plugin installed, uninstalled or changed |
|
169 * Not own. |
|
170 */ |
|
171 MHFPAtEcomListen* iCallback; |
|
172 |
|
173 /** |
|
174 * Current state of ECom interface listening: active or inactive |
|
175 */ |
|
176 THFPState iEcomListenState; |
|
177 |
|
178 /** |
|
179 * UID of the installed, uninstalled or changed plugin |
|
180 */ |
|
181 TUid iPluginUid; |
|
182 |
|
183 /** |
|
184 * Package for plugin UID |
|
185 */ |
|
186 TPckg<TUid> iPluginUidPckg; |
|
187 |
|
188 /** |
|
189 * Package for ECOM type |
|
190 */ |
|
191 TPckg<TATExtensionEcomType> iEcomTypePckg; |
|
192 |
|
193 }; |
|
194 |
|
195 #endif // C_CHFPATECOMLISTEN_H |