author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:15:33 +0300 | |
branch | RCL_3 |
changeset 85 | 38bb213f60ba |
parent 68 | 9da50d567e3c |
permissions | -rw-r--r-- |
63 | 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: Class implementing CCCAppViewPluginAknContainer |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef __CCAPPCOMMALAUNCHERCONTAINER_H |
|
20 |
#define __CCAPPCOMMALAUNCHERCONTAINER_H |
|
21 |
// INCLUDES |
|
22 |
#include "ccappcommlauncherheaders.h" |
|
23 |
#include <Pbk2Commands.hrh> |
|
24 |
#include "ccappstatuscontrol.h" |
|
25 |
#include <aknlongtapdetector.h> |
|
26 |
||
27 |
class CAknsBasicBackgroundControlContext; |
|
28 |
class CAknPreviewPopUpController; |
|
29 |
class CCCAppCommLauncherPlugin; |
|
30 |
class CCCAppCommLauncherHeaderControl; |
|
31 |
class CCCAppCommLauncherPbkCmd; |
|
32 |
class CCCAppStatusControl; |
|
33 |
class CPbk2ApplicationServices; |
|
34 |
class CSpbContentProvider; |
|
35 |
class MCCAViewLauncher; |
|
36 |
class CCCAExtensionFactory; |
|
37 |
class CCCAppCommLauncherCustomListBox; |
|
38 |
class CCCaFactoryExtensionNotifier; |
|
39 |
||
40 |
/** |
|
41 |
* Class implementing CCAppCommLauncher -container for controls |
|
42 |
* |
|
43 |
* @code |
|
44 |
* ?good_class_usage_example(s) |
|
45 |
* @endcode |
|
46 |
* |
|
47 |
* @lib ccappcommlauncherplugin.dll |
|
48 |
* @since S60 v5.0 |
|
49 |
*/ |
|
50 |
class CCCAppCommLauncherContainer : |
|
51 |
public CCCAppViewPluginAknContainer, |
|
52 |
public MEikListBoxObserver, |
|
53 |
public MCCAppContactHandlerNotifier, |
|
54 |
public MCCAStatusControlObserver, |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
55 |
public MAknLongTapDetectorCallBack |
63 | 56 |
{ |
57 |
public: // constructor and destructor |
|
58 |
||
59 |
/** |
|
60 |
* CCCAppCommLauncherContainer. |
|
61 |
* |
|
62 |
* @param aPlugin reference |
|
63 |
*/ |
|
64 |
CCCAppCommLauncherContainer( |
|
65 |
CCCAppCommLauncherPlugin& aPlugin ); |
|
66 |
||
67 |
/** |
|
68 |
* ~CCCAppCommLauncherContainer |
|
69 |
*/ |
|
70 |
virtual ~CCCAppCommLauncherContainer(); |
|
71 |
||
72 |
public: // Functions from base classes |
|
73 |
||
74 |
/** |
|
75 |
* From CCoeControl |
|
76 |
* (see details from baseclass ) |
|
77 |
*/ |
|
78 |
void Draw( const TRect& aRect ) const; |
|
79 |
||
80 |
/** |
|
81 |
* From CCoeControl |
|
82 |
* (see details from baseclass ) |
|
83 |
*/ |
|
84 |
virtual void SizeChanged(); |
|
85 |
||
86 |
/** |
|
87 |
* From CCoeControl |
|
88 |
* (see details from baseclass ) |
|
89 |
*/ |
|
90 |
void HandleResourceChange(TInt aType); |
|
91 |
||
92 |
/** |
|
93 |
* From CCoeControl |
|
94 |
* (see details from baseclass ) |
|
95 |
*/ |
|
96 |
TInt CountComponentControls() const; |
|
97 |
||
98 |
/** |
|
99 |
* From CCoeControl |
|
100 |
* (see details from baseclass ) |
|
101 |
*/ |
|
102 |
CCoeControl* ComponentControl( TInt aIndex ) const; |
|
103 |
||
104 |
/** |
|
105 |
* From CCoeControl |
|
106 |
* (see details from baseclass ) |
|
107 |
*/ |
|
108 |
TKeyResponse OfferKeyEventL( |
|
109 |
const TKeyEvent& aKeyEvent, TEventCode aType); |
|
110 |
||
111 |
/** |
|
112 |
* From CCoeControl |
|
113 |
* (see details from baseclass ) |
|
114 |
*/ |
|
115 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
116 |
||
117 |
/** |
|
118 |
* From CCoeControl |
|
119 |
* (see details from baseclass ) |
|
120 |
*/ |
|
121 |
void FocusChanged( TDrawNow aDrawNow ); |
|
122 |
||
123 |
/** |
|
124 |
* From CCoeControl |
|
125 |
* (see details from baseclass ) |
|
126 |
*/ |
|
127 |
void HandlePointerEventL( |
|
128 |
const TPointerEvent& aPointerEvent ); |
|
129 |
||
130 |
/** |
|
131 |
* Default callback function for CAknLongTapDetector member object. |
|
132 |
* Base class implementation does nothing |
|
133 |
* |
|
134 |
* @param aPenEventLocation Long tap event location relative to parent control. |
|
135 |
* @param aPenEventScreenLocation Long tap event location relative to screen. |
|
136 |
*/ |
|
137 |
void HandleLongTapEventL( const TPoint& aPenEventLocation, |
|
138 |
const TPoint& aPenEventScreenLocation ); |
|
139 |
||
140 |
/** |
|
141 |
* From MEikListBoxObserver |
|
142 |
* (see details from baseclass ) |
|
143 |
*/ |
|
144 |
void HandleListBoxEventL( |
|
145 |
CEikListBox *aListBox, TListBoxEvent aEventType ); |
|
146 |
||
147 |
/** |
|
148 |
* From MCCAppContactHandlerNotifier |
|
149 |
* (see details from baseclass ) |
|
150 |
*/ |
|
151 |
void ContactInfoFetchedNotifyL( |
|
152 |
const CCmsContactFieldInfo& aContactFieldInfo ); |
|
153 |
||
154 |
/** |
|
155 |
* From MCCAppContactHandlerNotifier |
|
156 |
* (see details from baseclass ) |
|
157 |
*/ |
|
158 |
void ContactFieldFetchedNotifyL( |
|
159 |
const CCmsContactField& aContactField ); |
|
160 |
||
161 |
/** |
|
162 |
* From MCCAppContactHandlerNotifier |
|
163 |
* (see details from baseclass ) |
|
164 |
*/ |
|
165 |
void ContactFieldFetchingCompletedL(); |
|
166 |
||
167 |
/** |
|
168 |
* From MCCAppContactHandlerNotifier |
|
169 |
* (see details from baseclass ) |
|
170 |
*/ |
|
171 |
void ContactsChangedL( /*MVPbkContactLink& aLink*/ ); |
|
172 |
||
173 |
/** |
|
174 |
* From MCCAppContactHandlerNotifier |
|
175 |
* (see details from baseclass ) |
|
176 |
*/ |
|
177 |
void ContactPresenceChangedL( const CCmsContactField& aContactField ); |
|
178 |
||
179 |
/** |
|
180 |
* From CCoeControl |
|
181 |
* (see details from baseclass ) |
|
182 |
*/ |
|
183 |
void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
184 |
||
185 |
/** |
|
186 |
* From MCCAStatusControlObserver |
|
187 |
*/ |
|
188 |
void StatusClickedL(); |
|
189 |
||
190 |
public: // New |
|
191 |
||
192 |
/** |
|
193 |
* Getter for plugin reference. |
|
194 |
* |
|
195 |
* @return Plugin reference |
|
196 |
* @since S60 v5.0 |
|
197 |
*/ |
|
198 |
CCCAppCommLauncherPlugin& Plugin(); |
|
199 |
||
200 |
/** |
|
201 |
* To check whether there are communication methods available |
|
202 |
* |
|
203 |
* @return ETrue if available, otherwise EFalse |
|
204 |
* @since S60 v5.0 |
|
205 |
*/ |
|
206 |
TBool CommMethodsAvailable(); |
|
207 |
||
208 |
/** |
|
209 |
* Getter for currently selected comm method. |
|
210 |
* |
|
211 |
* @return contact action |
|
212 |
* @since S60 v5.0 |
|
213 |
*/ |
|
214 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector SelectedCommunicationMethod(); |
|
215 |
||
216 |
/** |
|
217 |
* To check whether the listbox is highlight |
|
218 |
* |
|
219 |
* @return ETrue if Highlight,otherwise EFalse |
|
220 |
* @since S60 v5.0 |
|
221 |
*/ |
|
222 |
const TBool IsListBoxHighlightEnabled(); |
|
223 |
||
224 |
/** |
|
225 |
* Get the amount of the list box |
|
226 |
* |
|
227 |
* @return the amount of the list box. |
|
228 |
* @since S60 v5.0 |
|
229 |
*/ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
230 |
const TInt GetListBoxItemAmount() const; |
63 | 231 |
|
232 |
private: // New |
|
233 |
||
234 |
/** |
|
235 |
* Creates the listbox part and model for it |
|
236 |
* |
|
237 |
* @since S60 v5.0 |
|
238 |
*/ |
|
239 |
void CreateListboxControlL(); |
|
240 |
||
241 |
/** |
|
242 |
* Creates the status control |
|
243 |
*/ |
|
244 |
void CreateStatusControlL(); |
|
245 |
||
246 |
/** |
|
247 |
* Updates the number/address popup |
|
248 |
*/ |
|
249 |
void UpdatePopupL(); |
|
250 |
||
251 |
/** |
|
252 |
* Helper function for determining text truncation direction for the preview popup |
|
253 |
* |
|
254 |
* @param aContactAction The communication method |
|
255 |
*/ |
|
256 |
AknTextUtils::TClipDirection MapCommMethodToClipDirection( |
|
257 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aContactAction ); |
|
258 |
||
259 |
/** |
|
260 |
* Calls map commands |
|
261 |
* |
|
262 |
* @param aCommandId Command id |
|
263 |
*/ |
|
264 |
void DoShowMapCmdL( TPbk2CommandId aCommandId ); |
|
265 |
||
266 |
/** |
|
267 |
* Long tap detector |
|
268 |
* |
|
269 |
* @param none |
|
270 |
*/ |
|
271 |
CAknLongTapDetector& LongTapDetectorL(); |
|
272 |
/* |
|
273 |
* Gets called when ExtensionFactory plugin is installed/removed |
|
274 |
*/ |
|
275 |
static TInt CheckExtensionFactoryL(TAny* aPtr); |
|
276 |
||
277 |
/* |
|
278 |
* Hides/shows the status control based on Extensionfactory plugins |
|
279 |
* availability. |
|
280 |
*/ |
|
281 |
void DoCheckExtensionFactoryL(); |
|
282 |
||
283 |
/* |
|
284 |
* Launches find on map contact action |
|
285 |
*/ |
|
286 |
void HandleFindOnMapContactActionL(); |
|
287 |
||
288 |
/* |
|
289 |
* Launches generic contact action |
|
290 |
* @param aActionType - Contact Action |
|
291 |
*/ |
|
292 |
void HandleGenericContactActionL( |
|
293 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType ); |
|
294 |
||
295 |
/* |
|
296 |
* Used to check whether a Contact has only one number for initiating VoiceCall. |
|
297 |
* Fills selection to aSelectedField if only one field is possible |
|
298 |
* Only works with VoiceCall Contact Action Type |
|
299 |
* |
|
300 |
* @param aActionType - Contact ActionType. Here it should be EVoiceCallSelector |
|
301 |
* @param aSelectedField - Data of the selected field. (Phonenumber) |
|
302 |
* @return - returns ETrue, if more than one field is present for the contact which is capable |
|
303 |
* of VoiceCall. |
|
304 |
* In this case we need to show the field selection dialog |
|
305 |
* wherein the user will choose the number for which he wants to start VoiceCall. |
|
306 |
* |
|
307 |
* returns EFalse - Straight Forward. Voice call can be made directly, |
|
308 |
* since we have only once number for this contact. |
|
309 |
* The number to which VoiceCall needs to be made is filled in the aSelectedField. |
|
310 |
* |
|
311 |
*/ |
|
312 |
TBool IsVoiceCallFieldSelectionAmbiguous( |
|
313 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType, |
|
314 |
TPtrC& aSelectedField ); |
|
315 |
||
316 |
/* |
|
317 |
* Returns true if field has only one item |
|
318 |
* @param CCmsContactField |
|
319 |
*/ |
|
320 |
TBool HasFieldOnlyOneItem( const CCmsContactField& field ) const; |
|
321 |
||
322 |
/* |
|
323 |
* Returns true if field is voice call type |
|
324 |
* @param CCmsContactField |
|
325 |
*/ |
|
326 |
TBool IsVoiceCallType( const CCmsContactField& field ) const; |
|
327 |
||
328 |
/* |
|
329 |
* Returns true if contact has single address |
|
330 |
* @param aActionType - Contact ActionType. |
|
331 |
* @param aHandler - Contact Handler |
|
332 |
*/ |
|
333 |
TBool HasContactSingleAddress( |
|
334 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType, |
|
335 |
CCCAppCommLauncherContactHandler& aHandler ); |
|
336 |
||
337 |
||
338 |
/* |
|
339 |
* Executes contact action service with field selection |
|
340 |
* |
|
341 |
* @param aActionType - Contact ActionType. |
|
342 |
* @param aContactIdentifier - Contact Link |
|
343 |
* @param aFullName - Contact's Name |
|
344 |
*/ |
|
345 |
void ExecuteContactActionServiceWithFieldSelectionL( |
|
346 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType, |
|
347 |
TDesC8& aContactIdentifier, |
|
348 |
TDesC& aFullName ); |
|
349 |
||
350 |
/* |
|
351 |
* Executes contact actions service without field selections |
|
352 |
* |
|
353 |
* @param aActionType - Contact ActionType. |
|
354 |
* @param aContactIdentifier - Contact Link |
|
355 |
* @param aFullName - Contact's Name |
|
356 |
* @param aSelectedField - Contains the number to which |
|
357 |
* VoiceCall needs to be established. |
|
358 |
*/ |
|
359 |
void ExecuteContactActionServiceWithoutFieldSelectionL( |
|
360 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType, |
|
361 |
TDesC8& aContactIdentifier, |
|
362 |
TDesC& aFullName, |
|
363 |
TDesC& aSelectedField ); |
|
364 |
||
365 |
private: // Constructors |
|
366 |
||
367 |
/** |
|
368 |
* ConstructL |
|
369 |
*/ |
|
370 |
void ConstructL(); |
|
371 |
||
372 |
private: // Data |
|
373 |
||
374 |
/** |
|
375 |
* Control showing the header part of the view |
|
376 |
* Own. |
|
377 |
*/ |
|
378 |
CCCAppCommLauncherHeaderControl* iHeaderCtrl; |
|
379 |
||
380 |
/** |
|
381 |
* Control to show the status icon and the text |
|
382 |
*/ |
|
383 |
CCCAppStatusControl* iStatusControl; |
|
384 |
||
385 |
/** |
|
386 |
* Listbox for the "communication buttons" |
|
387 |
* Own. |
|
388 |
*/ |
|
389 |
CCCAppCommLauncherCustomListBox* iListBox; |
|
390 |
||
391 |
/** |
|
392 |
* Background for skinning |
|
393 |
* Own. |
|
394 |
*/ |
|
395 |
CAknsBasicBackgroundControlContext* iBackground; |
|
396 |
||
397 |
/** |
|
398 |
* Ref to plugin. |
|
399 |
* Not own. |
|
400 |
*/ |
|
401 |
CCCAppCommLauncherPlugin& iPlugin; |
|
402 |
/** |
|
403 |
* Model containing the launchpad data |
|
404 |
* Own. |
|
405 |
*/ |
|
406 |
CCCAppCommLauncherLPadModel* iModel; |
|
407 |
||
408 |
/** |
|
409 |
* Indicates if focus has been dragged around the list, helps with single tap launching |
|
410 |
*/ |
|
411 |
TBool iHasBeenDragged; |
|
412 |
||
413 |
/** |
|
414 |
* Number of rows in model |
|
415 |
*/ |
|
416 |
TInt iMdlRowCount; |
|
417 |
||
418 |
/** |
|
419 |
* Command handler |
|
420 |
* Own. |
|
421 |
*/ |
|
422 |
CCCAppCommLauncherPbkCmd* iPbkCmd; |
|
423 |
||
424 |
/** |
|
425 |
* AppServices |
|
426 |
* Not owned |
|
427 |
*/ |
|
428 |
CPbk2ApplicationServices* iAppServices; |
|
429 |
||
430 |
/** |
|
431 |
* Used for launching the Ecom plugins |
|
432 |
* Own. |
|
433 |
*/ |
|
434 |
MCCAViewLauncher* iViewLauncher; |
|
435 |
||
436 |
/** |
|
437 |
* ContentProvider |
|
438 |
* Own. |
|
439 |
*/ |
|
440 |
CSpbContentProvider* iProvider; |
|
441 |
||
442 |
/** |
|
443 |
* iLongTapDetector |
|
444 |
* Own. |
|
445 |
*/ |
|
446 |
CAknLongTapDetector* iLongTapDetector; |
|
447 |
||
448 |
/* |
|
449 |
* Used for hiding/showing the StatusControl |
|
450 |
* Own. |
|
451 |
*/ |
|
452 |
CCCaFactoryExtensionNotifier* iFactoryExtensionNotifier; |
|
453 |
||
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
454 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
455 |
TBool iLongTap; |
63 | 456 |
}; |
457 |
||
458 |
#endif // __CCAPPCOMMALAUNCHERCONTAINER_H |
|
459 |
||
460 |
// End of File |