|
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: Definition of the class CFscPocPluginImpl. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_FSCPOCPLUGINIMPL_H |
|
20 #define C_FSCPOCPLUGINIMPL_H |
|
21 |
|
22 //<cmail> |
|
23 #include "cfsccontactactionplugin.h" |
|
24 #include "mfscreasoncallback.h" |
|
25 #include <MVPbkContactObserver.h> |
|
26 #include "mfsccontactsetobserver.h" |
|
27 #include "FscActionPluginUtils.h" |
|
28 //</cmail> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CFscContactAction; |
|
32 class CAiwServiceHandler; |
|
33 class MFscContactActionPluginObserver; |
|
34 |
|
35 /** |
|
36 * PoC ( PTT over Cellular ) plugin implementation. |
|
37 * Contains implementation of PoC plugin. |
|
38 * |
|
39 * @lib fscpocplugin.lib |
|
40 * @since S60 3.1 |
|
41 */ |
|
42 class CFscPocPluginImpl : |
|
43 public CFscContactActionPlugin, |
|
44 public MFscReasonCallback, |
|
45 public MFscContactSetObserver |
|
46 { |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 * |
|
53 * @param aParams contact action plugin parameters |
|
54 * @return New instance of CFscPocPluginImpl |
|
55 */ |
|
56 static CFscPocPluginImpl* NewL( TAny* aParams ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CFscPocPluginImpl(); |
|
62 |
|
63 public: // From CFscContactActionPlugin |
|
64 |
|
65 /** |
|
66 * @see CFscContactActionPlugin::Uid |
|
67 */ |
|
68 virtual TUid Uid() const; |
|
69 |
|
70 /** |
|
71 * @see CFscContactActionPlugin::ActionList |
|
72 */ |
|
73 virtual const CArrayFix<TUid>* ActionList() const; |
|
74 |
|
75 /** |
|
76 * @see CFscContactActionPlugin::GetActionL |
|
77 */ |
|
78 virtual const MFscContactAction& GetActionL( |
|
79 TUid aActionUid ) const; |
|
80 |
|
81 /** |
|
82 * @see CFscContactActionPlugin::PriorityForContactSetL |
|
83 */ |
|
84 virtual void PriorityForContactSetL( |
|
85 TUid aActionUid, |
|
86 MFscContactSet& aContactSet, |
|
87 TFscContactActionVisibility& aActionMenuVisibility, |
|
88 TFscContactActionVisibility& aOptionsMenuVisibility, |
|
89 MFscContactActionPluginObserver* aObserver ); |
|
90 |
|
91 /** |
|
92 * @see CFscContactActionPlugin::CancelPriorityForContactSet |
|
93 */ |
|
94 virtual void CancelPriorityForContactSet(); |
|
95 |
|
96 /** |
|
97 * @see CFscContactActionPlugin::ExecuteL |
|
98 */ |
|
99 virtual void ExecuteL( |
|
100 TUid aActionUid, |
|
101 MFscContactSet& aContactSet, |
|
102 MFscContactActionPluginObserver* aObserver ); |
|
103 |
|
104 /** |
|
105 * @see CFscContactActionPlugin::CancelExecute |
|
106 */ |
|
107 virtual void CancelExecute(); |
|
108 |
|
109 public: // From MFscReasonCallback |
|
110 |
|
111 /** |
|
112 * @see MFscReasonCallback::GetReasonL |
|
113 */ |
|
114 virtual void GetReasonL( |
|
115 TUid aActionUid, |
|
116 TInt aReasonId, |
|
117 HBufC*& aReason ) const; |
|
118 |
|
119 private: |
|
120 |
|
121 /** |
|
122 * Makes call using Dial AIW API |
|
123 */ |
|
124 void MakeAiwCallL(); |
|
125 |
|
126 /** |
|
127 * Helper method to check if action can be executed with |
|
128 * given contacts in current context |
|
129 * |
|
130 * @param aActionId Action Id |
|
131 * @param aContactSet |
|
132 */ |
|
133 void CanExecuteL( |
|
134 TUid aActionUid, |
|
135 MFscContactSet& aContactSet ); |
|
136 |
|
137 /** |
|
138 * Updates action icons |
|
139 * |
|
140 * @param aActionId Action Id |
|
141 */ |
|
142 void UpdateActionIconL( TUid aActionUid ); |
|
143 |
|
144 /** |
|
145 * @see MFscContactSetObserver::NextContactComplete |
|
146 */ |
|
147 virtual void NextContactComplete( MVPbkStoreContact* aContact ); |
|
148 |
|
149 /** |
|
150 * @see MFscContactSetObserver::NextContactFailed |
|
151 */ |
|
152 virtual void NextContactFailed( TInt aError ); |
|
153 |
|
154 /** |
|
155 * @see MFscContactSetObserver::NextGroupComplete |
|
156 */ |
|
157 virtual void NextGroupComplete( MVPbkStoreContact* aContact ); |
|
158 |
|
159 /** |
|
160 * @see MFscContactSetObserver::NextGroupFailed |
|
161 */ |
|
162 virtual void NextGroupFailed( TInt aError ); |
|
163 |
|
164 /** |
|
165 * @see MFscContactSetObserver::GetGroupContactComplete |
|
166 */ |
|
167 virtual void GetGroupContactComplete( MVPbkStoreContact* aContact ); |
|
168 |
|
169 /** |
|
170 * @see MFscContactSetObserver::GetGroupContactFailed |
|
171 */ |
|
172 virtual void GetGroupContactFailed( TInt aError ); |
|
173 |
|
174 /** |
|
175 * Resets data |
|
176 */ |
|
177 void ResetData(); |
|
178 |
|
179 private: // constructors |
|
180 |
|
181 /** |
|
182 * Constructor. |
|
183 * |
|
184 * @param aParams contact action plugin parameters |
|
185 */ |
|
186 CFscPocPluginImpl( const TFscContactActionPluginParams& aParams ); |
|
187 |
|
188 /** |
|
189 * Second phase constructor. |
|
190 */ |
|
191 void ConstructL(); |
|
192 |
|
193 /** |
|
194 * Process retrieved contact. |
|
195 */ |
|
196 void ProcessContactL( MVPbkStoreContact* aContact ); |
|
197 |
|
198 /** |
|
199 * Process retrieved group. |
|
200 */ |
|
201 void ProcessGroupL( MVPbkStoreContact* aContact ); |
|
202 |
|
203 /** |
|
204 * Process retrieved group contact. |
|
205 */ |
|
206 void ProcessGroupContactL( MVPbkStoreContact* aContact ); |
|
207 |
|
208 |
|
209 |
|
210 private: // data |
|
211 |
|
212 /** |
|
213 * Action plugin parameters |
|
214 */ |
|
215 TFscContactActionPluginParams iParams; |
|
216 |
|
217 /** |
|
218 * Resource handle |
|
219 */ |
|
220 TInt iResourceHandle; |
|
221 |
|
222 /** |
|
223 * Own: Contact action for ptt call |
|
224 */ |
|
225 CFscContactAction* iContactPttAction; |
|
226 |
|
227 /** |
|
228 * Own: Contact action array |
|
229 */ |
|
230 CArrayFixFlat<TUid>* iActionList; |
|
231 |
|
232 /** |
|
233 * Own: AIW service handler |
|
234 */ |
|
235 CAiwServiceHandler* iAiwServiceHandler; |
|
236 |
|
237 /** |
|
238 * Plug-in observer |
|
239 */ |
|
240 MFscContactActionPluginObserver* iPluginObserver; |
|
241 |
|
242 /** |
|
243 * Phone numbers array |
|
244 */ |
|
245 CDesCArray* iSelectedPhNumArray; |
|
246 |
|
247 /** |
|
248 * Counter for contacts without POC number |
|
249 */ |
|
250 TInt iMissingCount; |
|
251 |
|
252 /** |
|
253 * Indicates if plugin is running in execution mode |
|
254 */ |
|
255 TBool iExecute; |
|
256 |
|
257 /** |
|
258 * Identifier of last event |
|
259 */ |
|
260 TActionPluginLastEvent iLastEvent; |
|
261 |
|
262 /** |
|
263 * Contact set |
|
264 */ |
|
265 MFscContactSet* iContactSet; |
|
266 |
|
267 /** |
|
268 * Action menu visbility |
|
269 */ |
|
270 TFscContactActionVisibility* iActionMenuVisibility; |
|
271 |
|
272 /** |
|
273 * Options menu visbility |
|
274 */ |
|
275 TFscContactActionVisibility* iOptionsMenuVisibility; |
|
276 |
|
277 /** |
|
278 * Action Uid |
|
279 */ |
|
280 TUid iActionUid; |
|
281 |
|
282 /** |
|
283 * Index of Store Contact In the group |
|
284 */ |
|
285 TInt iSCInGroup; |
|
286 |
|
287 /** |
|
288 * Store contact group pointer |
|
289 */ |
|
290 MVPbkStoreContact* iGroup; |
|
291 |
|
292 /** |
|
293 * Indicates if there is at least one PTT address in contact set |
|
294 */ |
|
295 TBool iIsNmbAvailable; |
|
296 |
|
297 /** |
|
298 * Index of group |
|
299 */ |
|
300 TInt iGroupIndex; |
|
301 }; |
|
302 |
|
303 #endif // C_FSCPOCPLUGINIMPL_H |