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: Implementation of commlauncher plugin control container |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDE FILES |
|
20 |
#include "ccappcommlauncherheaders.h" |
|
21 |
#include "spbcontentprovider.h" |
|
22 |
#include "ccappcommlaunchercustomlistbox.h" |
|
23 |
#include <Pbk2PresentationUtils.h> |
|
24 |
#include <CPbk2ApplicationServices.h> |
|
25 |
#include <CVPbkContactManager.h> |
|
26 |
#include <utf.h> |
|
27 |
#include <gulicon.h> |
|
28 |
#include "ccaextensionfactory.h" |
|
29 |
#include "ccaextensionfactory.hrh" |
|
30 |
#include <phonebook2ece.mbg> |
|
31 |
#include <aknlayoutscalable_avkon.cdl.h> |
|
32 |
#include <AknsUtils.h> |
|
33 |
#include <MVPbkContactStoreProperties.h> |
|
34 |
#include <VPbkContactStoreUris.h> |
|
35 |
#include <TVPbkContactStoreUriPtr.h> |
|
36 |
#include <MVPbkContactStore.h> |
|
37 |
#include "ccafactoryextensionnotifier.h" |
|
38 |
#include <featmgr.h> |
|
39 |
||
40 |
namespace { |
|
41 |
const TInt KSocialPhonebookDisabled = 2; |
|
42 |
const TInt KSocialPhonebookEnabled = 3; |
|
43 |
_LIT( KCcaIconDefaultFileName, "\\resource\\apps\\phonebook2ece.mif" ); |
|
44 |
} |
|
45 |
||
46 |
// =========================== MEMBER FUNCTIONS =============================== |
|
47 |
||
48 |
// ---------------------------------------------------------------------------- |
|
49 |
// CCCAppCommLauncherContainer::CCCAppCommLauncherContainer() |
|
50 |
// ---------------------------------------------------------------------------- |
|
51 |
// |
|
52 |
CCCAppCommLauncherContainer::CCCAppCommLauncherContainer( |
|
53 |
CCCAppCommLauncherPlugin& aPlugin) |
|
54 |
: iPlugin (aPlugin) |
|
55 |
{ |
|
56 |
} |
|
57 |
||
58 |
// ---------------------------------------------------------------------------- |
|
59 |
// CCCAppCommLauncherContainer::~CCCAppCommLauncherContainer() |
|
60 |
// ---------------------------------------------------------------------------- |
|
61 |
// |
|
62 |
CCCAppCommLauncherContainer::~CCCAppCommLauncherContainer() |
|
63 |
{ |
|
64 |
delete iListBox; |
|
65 |
delete iBackground; |
|
66 |
delete iModel; |
|
67 |
delete iHeaderCtrl; |
|
68 |
delete iPbkCmd; |
|
69 |
delete iStatusControl; |
|
70 |
delete iProvider; |
|
71 |
Release( iAppServices ); |
|
72 |
delete iViewLauncher; |
|
73 |
delete iLongTapDetector; |
|
74 |
delete iFactoryExtensionNotifier; |
|
75 |
} |
|
76 |
||
77 |
// ---------------------------------------------------------------------------- |
|
78 |
// CCCAppCommLauncherContainer::ConstructL() |
|
79 |
// ---------------------------------------------------------------------------- |
|
80 |
// |
|
81 |
void CCCAppCommLauncherContainer::ConstructL() |
|
82 |
{ |
|
83 |
// Create the listbox |
|
84 |
CreateListboxControlL(); |
|
85 |
// Create the header |
|
86 |
iHeaderCtrl = CCCAppCommLauncherHeaderControl::NewL( iPlugin ); |
|
87 |
iHeaderCtrl->SetContainerWindowL(*this); |
|
88 |
||
89 |
// create status control |
|
90 |
CreateStatusControlL(); |
|
91 |
||
92 |
// Get the skin background for the view |
|
93 |
iBackground = CAknsBasicBackgroundControlContext::NewL( |
|
94 |
KAknsIIDQsnBgAreaMain, TRect(0, 0, 0, 0), EFalse); |
|
95 |
LongTapDetectorL(); |
|
96 |
} |
|
97 |
||
98 |
// ---------------------------------------------------------------------------- |
|
99 |
// CCCAppCommLauncherContainer::CreateListboxControlL() |
|
100 |
// ---------------------------------------------------------------------------- |
|
101 |
// |
|
102 |
void CCCAppCommLauncherContainer::CreateListboxControlL() |
|
103 |
{ |
|
104 |
// Use customized list box |
|
105 |
iListBox = CCCAppCommLauncherCustomListBox::NewL(); |
|
106 |
iListBox->ConstructL(this, EAknListBoxLoopScrolling); |
|
107 |
iListBox->SetContainerWindowL(*this); |
|
108 |
iListBox->CreateScrollBarFrameL(ETrue); |
|
109 |
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( |
|
110 |
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); |
|
111 |
// Set empty text |
|
112 |
iListBox->View()->SetListEmptyTextL(KNullDesC()); |
|
113 |
||
114 |
// Creating the model |
|
115 |
iModel = CCCAppCommLauncherLPadModel::NewL(*this, *iListBox, iPlugin); |
|
116 |
iListBox->Model()->SetItemTextArray(iModel); |
|
117 |
iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); |
|
118 |
iListBox->ItemDrawer()->ColumnData()->SetIconArray(iModel->IconArray()); |
|
119 |
||
120 |
//Set listbox observer |
|
121 |
iListBox->SetListBoxObserver(this); |
|
122 |
iListBox->ActivateL(); |
|
123 |
} |
|
124 |
||
125 |
//----------------------------------------------------------------------------- |
|
126 |
// CCCAppCommLauncherContainer::CreateStatusControlL() |
|
127 |
//----------------------------------------------------------------------------- |
|
128 |
// |
|
129 |
void CCCAppCommLauncherContainer::CreateStatusControlL() |
|
130 |
{ |
|
131 |
FeatureManager::InitializeLibL(); |
|
132 |
const TBool isFeatureIdFfContactsSocial = |
|
133 |
FeatureManager::FeatureSupported( KFeatureIdFfContactsSocial ); |
|
134 |
FeatureManager::UnInitializeLib(); |
|
135 |
||
136 |
if( isFeatureIdFfContactsSocial ) |
|
137 |
{ |
|
138 |
MVPbkContactLink* link = NULL; |
|
139 |
MVPbkContactLinkArray* contactArray = NULL; |
|
140 |
TInt isSame = KErrNotFound; |
|
141 |
||
142 |
if( !iAppServices ) |
|
143 |
{ |
|
144 |
iAppServices = CPbk2ApplicationServices::InstanceL(); |
|
145 |
} |
|
146 |
if( !iProvider ) |
|
147 |
{ |
|
148 |
iProvider = CSpbContentProvider::NewL( iAppServices->ContactManager(), |
|
149 |
iAppServices->StoreManager(), |
|
150 |
CSpbContentProvider::EStatusMessage | |
|
151 |
CSpbContentProvider::EServiceIcon ); |
|
152 |
} |
|
153 |
HBufC& contactData = iPlugin.AppEngine()->Parameter().ContactDataL(); |
|
154 |
HBufC8* contactData8 = HBufC8::NewLC( contactData.Size() ); |
|
155 |
TPtr8 contactData8Ptr( contactData8->Des() ); |
|
156 |
contactData8Ptr.Copy( contactData.Des() ); |
|
157 |
||
158 |
CVPbkContactManager* vPbkContactManager = |
|
159 |
&iAppServices->ContactManager(); |
|
160 |
||
161 |
if( vPbkContactManager ) |
|
162 |
{ |
|
163 |
contactArray = vPbkContactManager->CreateLinksLC( contactData8Ptr ); |
|
164 |
||
165 |
if( contactArray->Count() > 0 ) |
|
166 |
{ |
|
167 |
link = contactArray->At( 0 ).CloneLC(); |
|
168 |
} |
|
169 |
||
170 |
if ( link ) |
|
171 |
{ |
|
172 |
const MVPbkContactStoreProperties& storeProperties = |
|
173 |
link->ContactStore().StoreProperties(); |
|
174 |
TVPbkContactStoreUriPtr uri = storeProperties.Uri(); |
|
175 |
||
176 |
isSame = uri.Compare( VPbkContactStoreUris::DefaultCntDbUri(), |
|
177 |
TVPbkContactStoreUriPtr::EContactStoreUriAllComponents ); |
|
178 |
} |
|
179 |
} |
|
180 |
||
181 |
if( isSame == 0 ) |
|
182 |
{ |
|
183 |
iStatusControl = CCCAppStatusControl::NewL( *iProvider, *this, CCCAppStatusControl::ENormalContact ); |
|
184 |
iStatusControl->SetContainerWindowL( *this ); |
|
185 |
iStatusControl->MakeVisible( EFalse ); |
|
186 |
iHeaderCtrl->SetStatusButtonVisibility( EFalse ); |
|
187 |
CFbsBitmap* bmp = NULL; |
|
188 |
CFbsBitmap* bmpMask = NULL; |
|
189 |
||
190 |
AknsUtils::CreateIconL( |
|
191 |
AknsUtils::SkinInstance(), |
|
192 |
KAknsIIDQgnPropSocialCommunities, |
|
193 |
bmp, |
|
194 |
bmpMask, |
|
195 |
KCcaIconDefaultFileName, |
|
196 |
EMbmPhonebook2eceQgn_prop_social_communities, |
|
197 |
EMbmPhonebook2eceQgn_prop_social_communities_mask ); |
|
198 |
||
199 |
CGulIcon* guiIcon = CGulIcon::NewL( bmp, bmpMask ); |
|
200 |
iStatusControl->SetDefaultStatusIconL( guiIcon ); |
|
201 |
HBufC* defaultText = |
|
202 |
StringLoader::LoadL( R_QTN_CCA_SOCIAL_NETWORKS ); |
|
203 |
iStatusControl->SetDefaultStatusTextL( defaultText ); |
|
204 |
iStatusControl->SetContactLinkL( *link ); |
|
205 |
||
206 |
iFactoryExtensionNotifier = CCCaFactoryExtensionNotifier::NewL(); |
|
207 |
TCallBack callBack( |
|
208 |
CCCAppCommLauncherContainer::CheckExtensionFactoryL, this ); |
|
209 |
iFactoryExtensionNotifier->ObserveExtensionFactoryL( callBack ); |
|
210 |
} |
|
211 |
||
212 |
if( link ) |
|
213 |
{ |
|
214 |
CleanupStack::PopAndDestroy(); //link |
|
215 |
} |
|
216 |
||
217 |
if( contactArray ) |
|
218 |
{ |
|
219 |
CleanupStack::PopAndDestroy(); // contactArray |
|
220 |
} |
|
221 |
||
222 |
CleanupStack::PopAndDestroy(); // contactData8 |
|
223 |
} // KFeatureIdFfContactsSocial |
|
224 |
} |
|
225 |
||
226 |
||
227 |
// ---------------------------------------------------------------------------- |
|
228 |
// CCCAppCommLauncherContainer::Draw() |
|
229 |
// ---------------------------------------------------------------------------- |
|
230 |
// |
|
231 |
void CCCAppCommLauncherContainer::Draw(const TRect& /*aRect*/) const |
|
232 |
{ |
|
233 |
// Draw the background using skin |
|
234 |
if (iBackground) |
|
235 |
{ |
|
236 |
AknsDrawUtils::Background( |
|
237 |
AknsUtils::SkinInstance(), iBackground, this, SystemGc(), Rect()); |
|
238 |
} |
|
239 |
} |
|
240 |
||
241 |
// ---------------------------------------------------------------------------- |
|
242 |
// CCCAppCommLauncherContainer::SizeChanged() |
|
243 |
// ---------------------------------------------------------------------------- |
|
244 |
// |
|
245 |
void CCCAppCommLauncherContainer::SizeChanged() |
|
246 |
{ |
|
247 |
const TRect rect(Rect()); |
|
248 |
const TBool isLandscape(Layout_Meta_Data::IsLandscapeOrientation()); |
|
249 |
||
250 |
// contact card pane layout |
|
251 |
TAknWindowComponentLayout contactCardPaneLayout( |
|
252 |
TAknWindowComponentLayout::Compose( |
|
253 |
AknLayoutScalable_Apps::main_phob2_pane( 0 ), |
|
254 |
AknLayoutScalable_Apps::phob2_contact_card_pane( 1 ) ) ); |
|
255 |
||
256 |
||
257 |
TInt option( isLandscape ? 3 : 2 ); // (w/o button) |
|
258 |
if( iStatusControl && iStatusControl->IsVisible() ) |
|
259 |
{ |
|
260 |
// (w button) |
|
261 |
if( isLandscape ) |
|
262 |
{ |
|
263 |
option = 1; |
|
264 |
} |
|
265 |
else |
|
266 |
{ |
|
267 |
option = 0; |
|
268 |
} |
|
269 |
||
270 |
// Status control layout |
|
271 |
TAknWindowComponentLayout statusPaneLayout( |
|
272 |
TAknWindowComponentLayout::Compose( |
|
273 |
TAknWindowComponentLayout::Compose( |
|
274 |
contactCardPaneLayout, |
|
275 |
AknLayoutScalable_Apps::phob2_cc_data_pane( option ) ), |
|
276 |
AknLayoutScalable_Apps::phob2_cc_button_pane( option ) ) ); |
|
277 |
||
278 |
TAknLayoutRect statusPaneLayoutRect; |
|
279 |
statusPaneLayoutRect.LayoutRect( rect, statusPaneLayout.LayoutLine() ); |
|
280 |
TRect statusPaneRect( statusPaneLayoutRect.Rect() ); |
|
281 |
iStatusControl->SetRect( statusPaneRect ); |
|
282 |
} |
|
283 |
// Header and Listbox |
|
284 |
||
285 |
// header layout |
|
286 |
TAknWindowComponentLayout headerPaneLayout( |
|
287 |
TAknWindowComponentLayout::Compose( |
|
288 |
contactCardPaneLayout, |
|
289 |
AknLayoutScalable_Apps::phob2_cc_data_pane( option ) ) ); |
|
290 |
||
291 |
TAknLayoutRect headerPaneLayoutRect; |
|
292 |
headerPaneLayoutRect.LayoutRect( rect, headerPaneLayout.LayoutLine() ); |
|
293 |
TRect headerPaneRect( headerPaneLayoutRect.Rect() ); |
|
294 |
iHeaderCtrl->SetRect( headerPaneRect ); |
|
295 |
||
296 |
// list layout |
|
297 |
TAknWindowComponentLayout listPaneLayout( |
|
298 |
TAknWindowComponentLayout::Compose( |
|
299 |
contactCardPaneLayout, |
|
300 |
AknLayoutScalable_Apps::phob2_cc_listscroll_pane( option ) ) ); |
|
301 |
||
302 |
TAknLayoutRect listPaneLayoutRect; |
|
303 |
listPaneLayoutRect.LayoutRect( rect, listPaneLayout.LayoutLine() ); |
|
304 |
TRect listPaneRect( listPaneLayoutRect.Rect() ); |
|
305 |
iListBox->SetRect( listPaneRect ); |
|
306 |
||
307 |
// Background skin |
|
308 |
if (iBackground) |
|
309 |
{ |
|
310 |
iBackground->SetRect(rect); |
|
311 |
} |
|
312 |
||
313 |
DrawDeferred(); |
|
314 |
} |
|
315 |
||
316 |
// ---------------------------------------------------------------------------- |
|
317 |
// CCCAppCommLauncherContainer::HandleResourceChange() |
|
318 |
// ---------------------------------------------------------------------------- |
|
319 |
// |
|
320 |
void CCCAppCommLauncherContainer::HandleResourceChange(TInt aType) |
|
321 |
{ |
|
322 |
if ( aType == KEikDynamicLayoutVariantSwitch ) |
|
323 |
{ |
|
324 |
TRAP_IGNORE( iModel->ResourceChangedL() ); |
|
325 |
} |
|
326 |
CCCAppViewPluginAknContainer::HandleResourceChange(aType); |
|
327 |
} |
|
328 |
||
329 |
// ---------------------------------------------------------------------------- |
|
330 |
// CCCAppCommLauncherContainer::CountComponentControls() |
|
331 |
// ---------------------------------------------------------------------------- |
|
332 |
// |
|
333 |
TInt CCCAppCommLauncherContainer::CountComponentControls() const |
|
334 |
{ |
|
335 |
if( iStatusControl ) |
|
336 |
{ |
|
337 |
return KSocialPhonebookEnabled; |
|
338 |
} |
|
339 |
else |
|
340 |
{ |
|
341 |
return KSocialPhonebookDisabled; |
|
342 |
} |
|
343 |
} |
|
344 |
||
345 |
// ---------------------------------------------------------------------------- |
|
346 |
// CCCAppCommLauncherContainer::ComponentControl() |
|
347 |
// ---------------------------------------------------------------------------- |
|
348 |
// |
|
349 |
CCoeControl* CCCAppCommLauncherContainer::ComponentControl(TInt aIndex) const |
|
350 |
{ |
|
351 |
switch (aIndex) |
|
352 |
{ |
|
353 |
case 0: |
|
354 |
return iHeaderCtrl; |
|
355 |
case 1: |
|
356 |
if( iStatusControl ) |
|
357 |
{ |
|
358 |
return iStatusControl; |
|
359 |
} |
|
360 |
else |
|
361 |
{ |
|
362 |
return iListBox; |
|
363 |
} |
|
364 |
case 2: |
|
365 |
if( iStatusControl ) |
|
366 |
{ |
|
367 |
return iListBox; |
|
368 |
} |
|
369 |
else |
|
370 |
{ |
|
371 |
return NULL; |
|
372 |
} |
|
373 |
default: |
|
374 |
return NULL; |
|
375 |
} |
|
376 |
} |
|
377 |
||
378 |
// ---------------------------------------------------------------------------- |
|
379 |
// CCCAppCommLauncherContainer::OfferKeyEventL() |
|
380 |
// ---------------------------------------------------------------------------- |
|
381 |
// |
|
382 |
TKeyResponse CCCAppCommLauncherContainer::OfferKeyEventL( |
|
383 |
const TKeyEvent& aKeyEvent, TEventCode aType) |
|
384 |
{ |
|
385 |
// Make sure timer can be canceled before user do any operation. |
|
386 |
iPlugin.CancelTimer(); |
|
387 |
||
388 |
// Forward the key-event 1st to base-class |
|
389 |
TKeyResponse returnValue = |
|
390 |
CCCAppViewPluginAknContainer::OfferKeyEventL(aKeyEvent, aType); |
|
391 |
||
392 |
// Offer event to header control. |
|
393 |
if (EEventKey == aType |
|
394 |
&& EKeyWasNotConsumed == returnValue) |
|
395 |
{ |
|
396 |
returnValue = iHeaderCtrl->OfferKeyEventL(aKeyEvent, aType); |
|
397 |
} |
|
398 |
||
399 |
/* Uncomment this code if it is necessary to enable navigation hardware keys |
|
400 |
* on devices which have these keys (its Map Extension feature) |
|
401 |
if( aKeyEvent.iScanCode == EStdKeyApplicationD && aType == EEventKeyUp ) |
|
402 |
{ |
|
403 |
DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionAssignFromMap ); |
|
404 |
returnValue = EKeyWasConsumed; |
|
405 |
} |
|
406 |
||
407 |
if( aKeyEvent.iScanCode == EStdKeyApplicationE && aType == EEventKeyUp ) |
|
408 |
{ |
|
409 |
DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionShowOnMap ); |
|
410 |
returnValue = EKeyWasConsumed; |
|
411 |
}*/ |
|
412 |
||
413 |
if (EEventKey == aType |
|
414 |
&& EKeyWasNotConsumed == returnValue) |
|
415 |
{ |
|
416 |
// Make send key work as the select key for the list |
|
417 |
TKeyEvent keyToList = aKeyEvent; |
|
418 |
if (EKeyYes == aKeyEvent.iCode && IsFocused()) |
|
419 |
{ |
|
420 |
keyToList.iCode = EKeyEnter; |
|
421 |
} |
|
422 |
returnValue = iListBox->OfferKeyEventL(keyToList, aType); |
|
423 |
// Update popup when moving up or down in the list |
|
424 |
switch(aKeyEvent.iCode) |
|
425 |
{ |
|
426 |
case EKeyUpArrow: |
|
427 |
case EKeyDownArrow: |
|
428 |
returnValue = EKeyWasConsumed; |
|
429 |
break; |
|
430 |
} |
|
431 |
} |
|
432 |
||
433 |
return returnValue; |
|
434 |
} |
|
435 |
||
436 |
// ---------------------------------------------------------------------------- |
|
437 |
// CCCAppCommLauncherContainer::MopSupplyObject() |
|
438 |
// ---------------------------------------------------------------------------- |
|
439 |
// |
|
440 |
TTypeUid::Ptr CCCAppCommLauncherContainer::MopSupplyObject(TTypeUid aId) |
|
441 |
{ |
|
442 |
// For skinning |
|
443 |
if (iBackground && aId.iUid == MAknsControlContext::ETypeId) |
|
444 |
{ |
|
445 |
return MAknsControlContext::SupplyMopObject(aId, iBackground); |
|
446 |
} |
|
447 |
||
448 |
return CCoeControl::MopSupplyObject(aId); |
|
449 |
} |
|
450 |
||
451 |
// ---------------------------------------------------------------------------- |
|
452 |
// CCCAppCommLauncherContainer::FocusChanged() |
|
453 |
// ---------------------------------------------------------------------------- |
|
454 |
// |
|
455 |
void CCCAppCommLauncherContainer::FocusChanged(TDrawNow aDrawNow) |
|
456 |
{ |
|
457 |
// For enabling animated hilight (if in skin supports it) |
|
458 |
CCoeControl::FocusChanged(aDrawNow); |
|
459 |
if(iListBox) |
|
460 |
{ |
|
461 |
iListBox->SetFocus(IsFocused(), aDrawNow); |
|
462 |
} |
|
463 |
} |
|
464 |
||
465 |
// ---------------------------------------------------------------------------- |
|
466 |
// CCCAppCommLauncherContainer::HandlePointerEventL() |
|
467 |
// ---------------------------------------------------------------------------- |
|
468 |
// |
|
469 |
void CCCAppCommLauncherContainer::HandlePointerEventL( |
|
470 |
const TPointerEvent& aPointerEvent) |
|
471 |
{ |
|
472 |
// Make sure timer can be canceled before user do any operation. |
|
473 |
iPlugin.CancelTimer(); |
|
474 |
||
475 |
TInt index; |
|
476 |
// start iLongTapDetector in listbox area and handle PointerEvent when dragged |
|
477 |
if ( iListBox->View()->XYPosToItemIndex( aPointerEvent.iPosition, index ) |
|
478 |
|| ( aPointerEvent.iType == TPointerEvent::EDrag ) ) |
|
479 |
{ |
|
480 |
if ( iLongTapDetector ) |
|
481 |
{ |
|
482 |
iLongTapDetector->PointerEventL( aPointerEvent ); |
|
483 |
} |
|
484 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) |
|
485 |
{ |
|
486 |
// Pressed Down Effect |
|
487 |
iListBox->View()->ItemDrawer()->SetFlags( |
|
488 |
CListItemDrawer::EPressedDownState ); |
|
489 |
} |
|
490 |
} |
|
491 |
||
492 |
CCoeControl::HandlePointerEventL( aPointerEvent ); |
|
493 |
} |
|
494 |
||
495 |
// ---------------------------------------------------------------------------- |
|
496 |
// CCCAppCommLauncherContainer::HandleLongTapEventL() |
|
497 |
// ---------------------------------------------------------------------------- |
|
498 |
// |
|
499 |
void CCCAppCommLauncherContainer::HandleLongTapEventL( const TPoint& /*aPenEventLocation*/, |
|
500 |
const TPoint& /*aPenEventScreenLocation*/ ) |
|
501 |
{ |
|
502 |
if ( iPlugin.CommandState().IsRunning() ) |
|
503 |
{ |
|
504 |
return; |
|
505 |
} |
|
506 |
else if ( CommMethodsAvailable() ) |
|
507 |
{ |
|
508 |
TPtrC fullName; |
|
509 |
iPlugin.ContactHandler().ContactFieldItemDataL( |
|
510 |
CCmsContactFieldItem::ECmsFullName, fullName ); |
|
511 |
||
512 |
TUint paramFlag = 0;//CCAContactorService::TCSParameter::EEnableDefaults; |
|
513 |
||
514 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector |
|
515 |
contactActionType = iPlugin.Container().SelectedCommunicationMethod(); |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
516 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
517 |
if ( !iLongTap && contactActionType |
63 | 518 |
== VPbkFieldTypeSelectorFactory::EFindOnMapSelector ) |
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
519 |
{ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
520 |
iLongTap = ETrue; |
63 | 521 |
DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionShowOnMap ); |
522 |
} |
|
523 |
else |
|
524 |
{ |
|
525 |
CCAContactorService::TCSParameter param( |
|
526 |
contactActionType, |
|
527 |
*iPlugin.ContactHandler().ContactIdentifierLC(),//contactlinkarray |
|
528 |
paramFlag, |
|
529 |
fullName ); |
|
530 |
||
531 |
iPlugin.ExecuteServiceL( param ); |
|
532 |
||
533 |
//The Timer can be started after user selected any call item |
|
534 |
if ( iPlugin.ContactorService()->IsSelected() && |
|
535 |
(contactActionType == VPbkFieldTypeSelectorFactory::EVoiceCallSelector || |
|
536 |
contactActionType == VPbkFieldTypeSelectorFactory::EVideoCallSelector || |
|
537 |
contactActionType == VPbkFieldTypeSelectorFactory::EVOIPCallSelector) ) |
|
538 |
{ |
|
539 |
iPlugin.StartTimerL(); |
|
540 |
} |
|
541 |
||
542 |
||
543 |
CleanupStack::PopAndDestroy( 1 );// contactlinkarray |
|
544 |
} |
|
545 |
} |
|
546 |
} |
|
547 |
||
548 |
// ---------------------------------------------------------------------------- |
|
549 |
// CCCAppCommLauncherContainer::HandleListBoxEventL() |
|
550 |
// ---------------------------------------------------------------------------- |
|
551 |
// |
|
552 |
void CCCAppCommLauncherContainer::HandleListBoxEventL( |
|
553 |
CEikListBox* /*aListBox*/, TListBoxEvent aEventType) |
|
554 |
{ |
|
555 |
// Handle pointer events |
|
556 |
TBool executeContactAction = EFalse; |
|
557 |
||
558 |
if (aEventType == EEventItemDraggingActioned) |
|
559 |
{ |
|
560 |
iHasBeenDragged = ETrue; |
|
561 |
} |
|
562 |
else if (aEventType == EEventItemSingleClicked) |
|
563 |
{ |
|
564 |
if (!iHasBeenDragged) |
|
565 |
{ |
|
566 |
executeContactAction = ETrue; |
|
567 |
} |
|
568 |
else |
|
569 |
{ |
|
570 |
iHasBeenDragged = EFalse; |
|
571 |
} |
|
572 |
} |
|
573 |
else if (aEventType == EEventEnterKeyPressed) |
|
574 |
{ |
|
575 |
executeContactAction = ETrue; |
|
576 |
iHasBeenDragged = EFalse; |
|
577 |
} |
|
578 |
||
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
579 |
if ( executeContactAction && iPlugin.CommandState().IsRunning() ) |
63 | 580 |
{ |
581 |
executeContactAction = EFalse; |
|
582 |
} |
|
583 |
||
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
584 |
if (executeContactAction) |
63 | 585 |
{ |
586 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector |
|
587 |
contactActionType = iPlugin.Container().SelectedCommunicationMethod(); |
|
588 |
||
589 |
if ( contactActionType |
|
590 |
== VPbkFieldTypeSelectorFactory::EFindOnMapSelector ) |
|
591 |
{ |
|
592 |
HandleFindOnMapContactActionL(); |
|
593 |
} |
|
594 |
else |
|
595 |
{ |
|
596 |
HandleGenericContactActionL( contactActionType ); |
|
597 |
} |
|
598 |
} |
|
599 |
} |
|
600 |
||
601 |
// ---------------------------------------------------------------------------- |
|
602 |
// CCCAppCommLauncherContainer::HandleFindOnMapContactActionL() |
|
603 |
// ---------------------------------------------------------------------------- |
|
604 |
// |
|
605 |
void CCCAppCommLauncherContainer::HandleFindOnMapContactActionL() |
|
606 |
{ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
607 |
if ( !iLongTap ) |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
608 |
{ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
609 |
DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionShowOnMap ); |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
610 |
} |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
611 |
else |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
612 |
{ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
613 |
iLongTap = EFalse; |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
614 |
} |
63 | 615 |
} |
616 |
||
617 |
// ---------------------------------------------------------------------------- |
|
618 |
// CCCAppCommLauncherContainer::HandleGenericContactActionL() |
|
619 |
// ---------------------------------------------------------------------------- |
|
620 |
// |
|
621 |
void CCCAppCommLauncherContainer::HandleGenericContactActionL( |
|
622 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType ) |
|
623 |
{ |
|
624 |
TPtrC fullName; |
|
625 |
iPlugin.ContactHandler().ContactFieldItemDataL( |
|
626 |
CCmsContactFieldItem::ECmsFullName, fullName ); |
|
627 |
||
628 |
//contactlinkarray |
|
629 |
HBufC8* contactIdentifier = iPlugin.ContactHandler().ContactIdentifierLC(); |
|
630 |
||
631 |
TBool fieldSelectionReq(ETrue); |
|
632 |
TPtrC selectedField; |
|
633 |
if ( VPbkFieldTypeSelectorFactory::EVoiceCallSelector == aActionType ) |
|
634 |
{ |
|
635 |
fieldSelectionReq = IsVoiceCallFieldSelectionAmbiguous( aActionType, selectedField ); |
|
636 |
} |
|
637 |
||
638 |
||
639 |
if( fieldSelectionReq ) |
|
640 |
{ |
|
641 |
ExecuteContactActionServiceWithFieldSelectionL( |
|
642 |
aActionType, |
|
643 |
*contactIdentifier, |
|
644 |
fullName ); |
|
645 |
} |
|
646 |
else |
|
647 |
{ |
|
648 |
// Speed up contact action by skipping slow field selection operation |
|
649 |
ExecuteContactActionServiceWithoutFieldSelectionL( |
|
650 |
aActionType, |
|
651 |
*contactIdentifier, |
|
652 |
fullName, |
|
653 |
selectedField ); |
|
654 |
} |
|
655 |
||
656 |
//The Timer can be started after user selected any call item |
|
657 |
if ( iPlugin.ContactorService()->IsSelected() && |
|
658 |
( aActionType == VPbkFieldTypeSelectorFactory::EVoiceCallSelector || |
|
659 |
aActionType == VPbkFieldTypeSelectorFactory::EVideoCallSelector || |
|
660 |
aActionType == VPbkFieldTypeSelectorFactory::EVOIPCallSelector) ) |
|
661 |
{ |
|
662 |
iPlugin.StartTimerL(); |
|
663 |
} |
|
664 |
||
665 |
CleanupStack::PopAndDestroy(1);// contactlinkarray |
|
666 |
} |
|
667 |
||
668 |
// ---------------------------------------------------------------------------- |
|
669 |
// CCCAppCommLauncherContainer::IsVoiceCallFieldSelectionAmbiguous() |
|
670 |
// ---------------------------------------------------------------------------- |
|
671 |
// |
|
672 |
TBool CCCAppCommLauncherContainer::IsVoiceCallFieldSelectionAmbiguous( |
|
673 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType, |
|
674 |
TPtrC& aSelectedField ) |
|
675 |
{ |
|
676 |
CCCAppCommLauncherContactHandler& handler = iPlugin.ContactHandler(); |
|
677 |
||
678 |
if ( HasContactSingleAddress( aActionType, handler ) ) |
|
679 |
{ |
|
680 |
RPointerArray<CCmsContactField>& fields = handler.ContactFieldDataArray(); |
|
681 |
||
682 |
for( TInt i=0; i < fields.Count(); i++ ) |
|
683 |
{ |
|
684 |
CCmsContactField* field = fields[i]; |
|
685 |
||
686 |
if ( HasFieldOnlyOneItem( *field ) && |
|
687 |
IsVoiceCallType( *field ) ) |
|
688 |
{ |
|
689 |
const CCmsContactFieldItem* fieldItem = NULL; |
|
690 |
||
691 |
TInt error = KErrNone; |
|
692 |
TRAP( error, fieldItem = &field->ItemL( 0 ) ); |
|
693 |
||
694 |
if( error == KErrNone ) |
|
695 |
{ |
|
696 |
aSelectedField.Set(fieldItem->Data()); |
|
697 |
//Its safe to exit here |
|
698 |
//Making of Voice Call is not tedious |
|
699 |
//we have only one number |
|
700 |
return EFalse; |
|
701 |
} |
|
702 |
} |
|
703 |
} |
|
704 |
} |
|
705 |
||
706 |
return ETrue; |
|
707 |
} |
|
708 |
||
709 |
// ---------------------------------------------------------------------------- |
|
710 |
// CCCAppCommLauncherContainer::HasContactSingleAddress() |
|
711 |
// ---------------------------------------------------------------------------- |
|
712 |
// |
|
713 |
TBool CCCAppCommLauncherContainer::HasContactSingleAddress( |
|
714 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType, |
|
715 |
CCCAppCommLauncherContactHandler& aHandler ) |
|
716 |
{ |
|
717 |
TInt amount = aHandler.AddressAmount( aActionType ); |
|
718 |
if( 1 == amount ) |
|
719 |
{ |
|
720 |
return ETrue; |
|
721 |
} |
|
722 |
||
723 |
return EFalse; |
|
724 |
} |
|
725 |
||
726 |
// ---------------------------------------------------------------------------- |
|
727 |
// CCCAppCommLauncherContainer::HasFieldOnlyOneItem() |
|
728 |
// ---------------------------------------------------------------------------- |
|
729 |
// |
|
730 |
TBool CCCAppCommLauncherContainer::HasFieldOnlyOneItem( const CCmsContactField& field ) const |
|
731 |
{ |
|
732 |
const RPointerArray<CCmsContactFieldItem>& items = field.Items(); |
|
733 |
||
734 |
if ( 1 == items.Count() ) |
|
735 |
{ |
|
736 |
return ETrue; |
|
737 |
} |
|
738 |
||
739 |
return EFalse; |
|
740 |
} |
|
741 |
||
742 |
// ---------------------------------------------------------------------------- |
|
743 |
// CCCAppCommLauncherContainer::IsVoiceCallType() |
|
744 |
// ---------------------------------------------------------------------------- |
|
745 |
// |
|
746 |
TBool CCCAppCommLauncherContainer::IsVoiceCallType( const CCmsContactField& field ) const |
|
747 |
{ |
|
748 |
CCmsContactFieldItem::TCmsContactField fieldType = field.Type(); |
|
749 |
||
750 |
if( fieldType == CCmsContactFieldItem::ECmsLandPhoneGeneric || |
|
751 |
fieldType == CCmsContactFieldItem::ECmsLandPhoneHome || |
|
752 |
fieldType == CCmsContactFieldItem::ECmsLandPhoneWork || |
|
753 |
fieldType == CCmsContactFieldItem::ECmsMobilePhoneGeneric || |
|
754 |
fieldType == CCmsContactFieldItem::ECmsMobilePhoneHome || |
|
755 |
fieldType == CCmsContactFieldItem::ECmsMobilePhoneWork ) |
|
756 |
{ |
|
757 |
return ETrue; |
|
758 |
} |
|
759 |
||
760 |
return EFalse; |
|
761 |
} |
|
762 |
||
763 |
||
764 |
// ---------------------------------------------------------------------------- |
|
765 |
// CCCAppCommLauncherContainer::ExecuteContactActionServiceWithFieldSelectionL() |
|
766 |
// ---------------------------------------------------------------------------- |
|
767 |
// |
|
768 |
void CCCAppCommLauncherContainer::ExecuteContactActionServiceWithFieldSelectionL( |
|
769 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType, |
|
770 |
TDesC8& aContactIdentifier, |
|
771 |
TDesC& aFullName ) |
|
772 |
{ |
|
773 |
TUint paramFlag = CCAContactorService::TCSParameter::EEnableDefaults; |
|
774 |
||
775 |
CCAContactorService::TCSParameter param( |
|
776 |
aActionType, |
|
777 |
aContactIdentifier, |
|
778 |
paramFlag, |
|
779 |
aFullName ); |
|
780 |
||
781 |
iPlugin.ExecuteServiceL(param); |
|
782 |
} |
|
783 |
||
784 |
// ---------------------------------------------------------------------------- |
|
785 |
// CCCAppCommLauncherContainer::ExecuteContactActionServiceWithoutFieldSelectionL() |
|
786 |
// ---------------------------------------------------------------------------- |
|
787 |
// |
|
788 |
void CCCAppCommLauncherContainer::ExecuteContactActionServiceWithoutFieldSelectionL( |
|
789 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType, |
|
790 |
TDesC8& aContactIdentifier, |
|
791 |
TDesC& aFullName, |
|
792 |
TDesC& aSelectedField ) |
|
793 |
{ |
|
794 |
CCAContactorService::TCSParameter param( |
|
795 |
aActionType, |
|
796 |
aContactIdentifier, |
|
797 |
CCAContactorService::TCSParameter::EUseFieldParam, |
|
798 |
aFullName, |
|
799 |
aSelectedField ); |
|
800 |
||
801 |
iPlugin.ExecuteServiceL(param); |
|
802 |
} |
|
803 |
||
804 |
// ---------------------------------------------------------------------------- |
|
805 |
// CCCAppCommLauncherContainer::ContactInfoFetchedNotifyL() |
|
806 |
// ---------------------------------------------------------------------------- |
|
807 |
// |
|
808 |
void CCCAppCommLauncherContainer::ContactInfoFetchedNotifyL( |
|
809 |
const CCmsContactFieldInfo& aContactFieldInfo) |
|
810 |
{ |
|
811 |
// update buttons |
|
812 |
iModel->UpdateAddressesValidationL( aContactFieldInfo ); |
|
813 |
iModel->FillButtonArrayL(); |
|
814 |
iListBox->HandleItemAdditionL(); |
|
815 |
iHeaderCtrl->ContactInfoFetchedNotifyL(aContactFieldInfo); |
|
816 |
||
817 |
if (!CommMethodsAvailable()) |
|
818 |
{ |
|
819 |
// update the empty string now to avoid flickering |
|
820 |
HBufC* string = StringLoader::LoadLC( |
|
821 |
R_QTN_CCA_NO_COMMUNICATION_METHODS, iCoeEnv); |
|
822 |
iListBox->View()->SetListEmptyTextL(*string); |
|
823 |
CleanupStack::PopAndDestroy(string); |
|
824 |
} |
|
825 |
} |
|
826 |
||
827 |
// ---------------------------------------------------------------------------- |
|
828 |
// CCCAppCommLauncherContainer::ContactFieldFetchedNotifyL() |
|
829 |
// ---------------------------------------------------------------------------- |
|
830 |
// |
|
831 |
void CCCAppCommLauncherContainer::ContactFieldFetchedNotifyL( |
|
832 |
const CCmsContactField& aContactField) |
|
833 |
{ |
|
834 |
// Forwarding to header-part |
|
835 |
iHeaderCtrl->ContactFieldFetchedNotifyL(aContactField); |
|
836 |
// Forwarding to listbox-model |
|
837 |
iModel->ContactFieldFetchedNotifyL(aContactField); |
|
838 |
} |
|
839 |
||
840 |
// ---------------------------------------------------------------------------- |
|
841 |
// CCCAppCommLauncherContainer::ContactFieldFetchedNotifyL() |
|
842 |
// ---------------------------------------------------------------------------- |
|
843 |
// |
|
844 |
void CCCAppCommLauncherContainer::ContactFieldFetchingCompletedL() |
|
845 |
{ |
|
846 |
//PERFORMANCE LOGGING: 12. Plugin ready |
|
847 |
WriteToPerfLog(); |
|
848 |
iHeaderCtrl->ContactFieldFetchingCompletedL(); |
|
849 |
||
850 |
iHeaderCtrl->SetContactStoreL(iPlugin.ContactHandler().ContactStore()); |
|
851 |
||
852 |
//Reset focused row in listbox if items removed/added. |
|
853 |
TInt mdlCount = iModel->MdcaCount(); |
|
854 |
if (iMdlRowCount != mdlCount) |
|
855 |
{ |
|
856 |
iListBox->SetCurrentItemIndexAndDraw(0); |
|
857 |
} |
|
858 |
iListBox->DrawDeferred(); |
|
859 |
||
860 |
iMdlRowCount = mdlCount; |
|
861 |
} |
|
862 |
||
863 |
// --------------------------------------------------------------------------- |
|
864 |
// CCCAppCommLauncherContainer::Plugin |
|
865 |
// --------------------------------------------------------------------------- |
|
866 |
// |
|
867 |
CCCAppCommLauncherPlugin& CCCAppCommLauncherContainer::Plugin() |
|
868 |
{ |
|
869 |
CCA_DP(KCommLauncherLogFile, CCA_L("CCCAppCommLauncherContainer::Plugin()")); |
|
870 |
return iPlugin; |
|
871 |
} |
|
872 |
||
873 |
// --------------------------------------------------------------------------- |
|
874 |
// CCCAppCommLauncherContainer::CommMethodsAvailable |
|
875 |
// --------------------------------------------------------------------------- |
|
876 |
// |
|
877 |
TBool CCCAppCommLauncherContainer::CommMethodsAvailable() |
|
878 |
{ |
|
879 |
return (KErrNotFound == iListBox->CurrentItemIndex()) |
|
880 |
? EFalse : ETrue; |
|
881 |
} |
|
882 |
||
883 |
// --------------------------------------------------------------------------- |
|
884 |
// CCCAppCommLauncherContainer::IsHighlight |
|
885 |
// --------------------------------------------------------------------------- |
|
886 |
// |
|
887 |
const TBool CCCAppCommLauncherContainer::IsListBoxHighlightEnabled() |
|
888 |
{ |
|
889 |
return !( iListBox->ItemDrawer()->Flags() & |
|
890 |
CListItemDrawer::ESingleClickDisabledHighlight ); |
|
891 |
} |
|
892 |
||
893 |
||
894 |
// --------------------------------------------------------------------------- |
|
895 |
// CCCAppCommLauncherContainer::SelectedCommunicationMethod |
|
896 |
// --------------------------------------------------------------------------- |
|
897 |
// |
|
898 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector |
|
899 |
CCCAppCommLauncherContainer::SelectedCommunicationMethod() |
|
900 |
{ |
|
901 |
return iModel->ButtonData(iListBox->CurrentItemIndex()).iContactAction; |
|
902 |
} |
|
903 |
||
904 |
// --------------------------------------------------------------------------- |
|
905 |
// CCCAppCommLauncherContainer::ContactsChangedL |
|
906 |
// --------------------------------------------------------------------------- |
|
907 |
// |
|
908 |
void CCCAppCommLauncherContainer::ContactsChangedL() |
|
909 |
{ |
|
910 |
iModel->Reset(); |
|
911 |
iListBox->HandleItemRemovalL(); |
|
912 |
iHeaderCtrl->ClearL(); |
|
913 |
||
914 |
if (!iStatusControl && iPlugin.ContactHandler().ContactStore() == ECmsContactStorePbk) |
|
915 |
{ |
|
916 |
// create status control |
|
917 |
CreateStatusControlL(); |
|
918 |
//reset control's rect |
|
919 |
SizeChanged(); |
|
920 |
} |
|
921 |
||
922 |
} |
|
923 |
||
924 |
// --------------------------------------------------------------------------- |
|
925 |
// CCCAppCommLauncherContainer::ContactPresenceChangedL |
|
926 |
// --------------------------------------------------------------------------- |
|
927 |
// |
|
928 |
void CCCAppCommLauncherContainer::ContactPresenceChangedL( |
|
929 |
const CCmsContactField& aContactField) |
|
930 |
{ |
|
931 |
iModel->ContactPresenceChangedL(aContactField); |
|
932 |
DrawDeferred(); |
|
933 |
} |
|
934 |
||
935 |
// --------------------------------------------------------------------------- |
|
936 |
// CCCAppCommLauncherContainer::MapCommMethodToClipDirection |
|
937 |
// --------------------------------------------------------------------------- |
|
938 |
// |
|
939 |
AknTextUtils::TClipDirection CCCAppCommLauncherContainer::MapCommMethodToClipDirection( |
|
940 |
VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aContactAction) |
|
941 |
{ |
|
942 |
switch (aContactAction) |
|
943 |
{ |
|
944 |
case VPbkFieldTypeSelectorFactory::EEmailEditorSelector: |
|
945 |
case VPbkFieldTypeSelectorFactory::EInstantMessagingSelector: |
|
946 |
case VPbkFieldTypeSelectorFactory::EVOIPCallSelector: |
|
947 |
case VPbkFieldTypeSelectorFactory::EVideoCallSelector: |
|
948 |
case VPbkFieldTypeSelectorFactory::EVoiceCallSelector: |
|
949 |
case VPbkFieldTypeSelectorFactory::EUniEditorSelector: |
|
950 |
return AknTextUtils::EClipFromBeginning; |
|
951 |
case VPbkFieldTypeSelectorFactory::EURLSelector: |
|
952 |
return AknTextUtils::EClipFromEnd; |
|
953 |
default: |
|
954 |
return AknTextUtils::EClipFromEnd; |
|
955 |
} |
|
956 |
} |
|
957 |
||
958 |
// ---------------------------------------------------------------------------- |
|
959 |
// CCCAppCommLauncherContainer::GetHelpContext() |
|
960 |
// ---------------------------------------------------------------------------- |
|
961 |
// |
|
962 |
void CCCAppCommLauncherContainer::GetHelpContext(TCoeHelpContext& aContext) const |
|
963 |
{ |
|
964 |
aContext.iMajor.iUid = KPbk2UID3; |
|
965 |
aContext.iContext = KHLP_CCA_LAUNCHER; |
|
966 |
} |
|
967 |
||
968 |
// --------------------------------------------------------------------------- |
|
969 |
// CCCAppCommLauncherContainer::DoShowMapCmdL |
|
970 |
// --------------------------------------------------------------------------- |
|
971 |
// |
|
972 |
void CCCAppCommLauncherContainer::DoShowMapCmdL( TPbk2CommandId aCommandId ) |
|
973 |
{ |
|
974 |
if( !iPbkCmd ) |
|
975 |
{ |
|
976 |
iPbkCmd = CCCAppCommLauncherPbkCmd::NewL( iPlugin ); |
|
977 |
} |
|
978 |
||
979 |
||
980 |
iPbkCmd->ExecutePbk2CmdShowMapL( |
|
981 |
iPlugin.ContactHandler().ContactIdentifierLC(), aCommandId ); |
|
982 |
||
983 |
CleanupStack::PopAndDestroy( 1 ); // ContactIdentifierLC |
|
984 |
||
985 |
} |
|
986 |
||
987 |
// -------------------------------------------------------------------------- |
|
988 |
// CCCAppCommLauncherContainer::LongTapDetectorL |
|
989 |
// -------------------------------------------------------------------------- |
|
990 |
// |
|
991 |
CAknLongTapDetector& CCCAppCommLauncherContainer::LongTapDetectorL() |
|
992 |
{ |
|
993 |
if ( !iLongTapDetector ) |
|
994 |
{ |
|
995 |
iLongTapDetector = CAknLongTapDetector::NewL( this ); |
|
996 |
} |
|
997 |
return *iLongTapDetector; |
|
998 |
} |
|
999 |
||
1000 |
//----------------------------------------------------------------------------- |
|
1001 |
// CCCAppCommLauncherContainer::StatusClicked() |
|
1002 |
//----------------------------------------------------------------------------- |
|
1003 |
// |
|
1004 |
void CCCAppCommLauncherContainer::StatusClickedL() |
|
1005 |
{ |
|
1006 |
if ( iViewLauncher ) |
|
1007 |
{ |
|
1008 |
HBufC& contactData = iPlugin.AppEngine()->Parameter().ContactDataL(); |
|
1009 |
HBufC8* contactData8 = HBufC8::NewLC( contactData.Size() ); |
|
1010 |
TPtr8 contactData8Ptr( contactData8->Des() ); |
|
1011 |
contactData8Ptr.Copy( contactData.Des() ); |
|
1012 |
iViewLauncher->LaunchViewL( MCCAViewLauncher::ECCAView, &contactData8Ptr ); |
|
1013 |
CleanupStack::PopAndDestroy( contactData8 ); |
|
1014 |
} |
|
1015 |
} |
|
1016 |
||
1017 |
//----------------------------------------------------------------------------- |
|
1018 |
// CCCAppCommLauncherContainer::CheckExtensionFactoryL() |
|
1019 |
//----------------------------------------------------------------------------- |
|
1020 |
// |
|
1021 |
TInt CCCAppCommLauncherContainer::CheckExtensionFactoryL(TAny* aPtr) |
|
1022 |
{ |
|
1023 |
CCCAppCommLauncherContainer* self = static_cast<CCCAppCommLauncherContainer*>( aPtr ); |
|
1024 |
self->DoCheckExtensionFactoryL(); |
|
1025 |
return 0; |
|
1026 |
} |
|
1027 |
||
1028 |
//----------------------------------------------------------------------------- |
|
1029 |
// CCCAppCommLauncherContainer::DoCheckExtensionFactoryL() |
|
1030 |
//----------------------------------------------------------------------------- |
|
1031 |
// |
|
1032 |
void CCCAppCommLauncherContainer::DoCheckExtensionFactoryL() |
|
1033 |
{ |
|
1034 |
CCCAExtensionFactory* extension = iFactoryExtensionNotifier->ExtensionFactory(); |
|
1035 |
||
1036 |
MCCAStatusProvider* ccaStatusProvider = NULL; |
|
1037 |
||
1038 |
// if extension is not null, extensionfactory plugins are available -> |
|
1039 |
// show statuscontrol |
|
1040 |
if( extension ) |
|
1041 |
{ |
|
1042 |
if ( !iViewLauncher ) |
|
1043 |
{ |
|
1044 |
iViewLauncher = extension->CreateViewLauncherL(); |
|
1045 |
} |
|
1046 |
if( iStatusControl ) |
|
1047 |
{ |
|
1048 |
if( extension ) |
|
1049 |
{ |
|
1050 |
TAny* factoryExtension = extension->FactoryExtension( KCCAExtensionFactoryStatusProviderCreatorUid ); |
|
1051 |
||
1052 |
if( factoryExtension ) |
|
1053 |
{ |
|
1054 |
MCCAExtensionFactoryStatusProviderCreator* statusProviderCreator = |
|
1055 |
static_cast<MCCAExtensionFactoryStatusProviderCreator*>( factoryExtension ); |
|
1056 |
||
1057 |
if( statusProviderCreator ) |
|
1058 |
{ |
|
1059 |
ccaStatusProvider = statusProviderCreator->CreateStatusProviderL(); |
|
1060 |
} |
|
1061 |
} |
|
1062 |
} |
|
1063 |
||
1064 |
iStatusControl->SetStatusProvider( ccaStatusProvider ); |
|
1065 |
iStatusControl->MakeVisible( ETrue ); |
|
1066 |
iHeaderCtrl->SetStatusButtonVisibility( ETrue ); |
|
1067 |
} |
|
1068 |
} |
|
1069 |
else |
|
1070 |
{ |
|
1071 |
delete iViewLauncher; |
|
1072 |
iViewLauncher = NULL; |
|
1073 |
if( iStatusControl ) |
|
1074 |
{ |
|
1075 |
iStatusControl->MakeVisible( EFalse ); |
|
1076 |
iHeaderCtrl->SetStatusButtonVisibility( EFalse ); |
|
1077 |
} |
|
1078 |
} |
|
1079 |
||
1080 |
} |
|
1081 |
||
1082 |
//----------------------------------------------------------------------------- |
|
1083 |
// CCCAppCommLauncherContainer::GetListBoxItemAmount() |
|
1084 |
//----------------------------------------------------------------------------- |
|
1085 |
// |
|
1086 |
const TInt CCCAppCommLauncherContainer::GetListBoxItemAmount() const |
|
1087 |
{ |
|
1088 |
return iModel->MdcaCount(); |
|
1089 |
} |
|
1090 |
// End of File |