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