diff -r fcdfafb36fe7 -r aecbbf00d063 uifw/AvKon/src/aknlistquerydialog.cpp --- a/uifw/AvKon/src/aknlistquerydialog.cpp Thu Aug 19 10:11:06 2010 +0300 +++ b/uifw/AvKon/src/aknlistquerydialog.cpp Tue Aug 31 15:28:30 2010 +0300 @@ -19,7 +19,8 @@ #include #include #include -#include +#include +#include #include "aknPopupHeadingPane.h" #include "aknlistquerycontrol.h" @@ -57,7 +58,6 @@ #endif #include // for testability hooks -#include "akntrace.h" NONSHARABLE_CLASS(CAknListQueryMediatorObserver): public CBase, public MAknDialogMediatorObserver { public: @@ -161,38 +161,32 @@ EXPORT_C CAknListQueryDialog::CAknListQueryDialog(TInt* aIndex) : CAknQueryDialog(ENoTone) { - _AKNTRACE_FUNC_ENTER; iIndex = aIndex; iEnterKeyPressed = EFalse; GfxTransEffect::Register(this,KGfxContextMenuControlUid); AKNTASHOOK_ADD( this, "CAknListQueryDialog" ); - _AKNTRACE_FUNC_EXIT; } EXPORT_C CAknListQueryDialog::CAknListQueryDialog(CListBoxView::CSelectionIndexArray* aSelectionIndexArray) : CAknQueryDialog(ENoTone) { - _AKNTRACE_FUNC_ENTER; iSelectionIndexArray = aSelectionIndexArray; iEnterKeyPressed = EFalse; GfxTransEffect::Register(this,KGfxContextMenuControlUid); AKNTASHOOK_ADD( this, "CAknListQueryDialog" ); - _AKNTRACE_FUNC_EXIT; } EXPORT_C CAknListQueryDialog::~CAknListQueryDialog() { - _AKNTRACE( "[%s][%s] Enter", "CAknListQueryDialog", "~CAknListQueryDialog" ); AKNTASHOOK_REMOVE(); if (iMediatorObs) CEikDialog::SetMediatorObserver(0); // Cover UI support cannot handle dialog it self as external observer delete iMediatorObs; delete iIdle; - _AKNTRACE( "[%s][%s] Exit", "CAknListQueryDialog", "~CAknListQueryDialog" ); } EXPORT_C CEikListBox *CAknListQueryDialog::ListBox() const @@ -239,7 +233,6 @@ EXPORT_C void CAknListQueryDialog::PreLayoutDynInitL() { - _AKNTRACE_FUNC_ENTER; CAknListQuerySearchControl *control1 = (CAknListQuerySearchControl*)ControlOrNull(EFindControl); CAknSearchField *control = NULL; CAknSearchField::TSearchFieldStyle flags = CAknSearchField::EPopupWindow; @@ -275,12 +268,10 @@ SetLineNonFocusing(EListQueryControl); Line(EFindControl)->SetDrawNoWhiteBackground(ETrue); } - _AKNTRACE_FUNC_EXIT; } EXPORT_C void CAknListQueryDialog::SetIconArrayL(CArrayPtr* aIcons) { - _AKNTRACE_FUNC_ENTER; CEikFormattedCellListBox* listbox = STATIC_CAST(CEikFormattedCellListBox*,ListBox()); CArrayPtr* oldicons = listbox->ItemDrawer()->FormattedCellData()->IconArray(); @@ -290,12 +281,10 @@ delete oldicons; } listbox->ItemDrawer()->FormattedCellData()->SetIconArrayL(aIcons); - _AKNTRACE_FUNC_EXIT; } EXPORT_C void CAknListQueryDialog::PostLayoutDynInitL() { - _AKNTRACE_FUNC_ENTER; CEikFormattedCellListBox* listbox = STATIC_CAST(CEikFormattedCellListBox*,ListBox()); // Now we'll load default icons if existing icon array does not exists. @@ -328,12 +317,10 @@ CleanupStack::Pop(); // icon for EMbmAvkonQgn_prop_checkbox_on CleanupStack::Pop(); // icons array } - _AKNTRACE_FUNC_EXIT; } EXPORT_C void CAknListQueryDialog::SetSizeAndPosition(const TSize & /*aSize*/) { - _AKNTRACE_FUNC_ENTER; AknPopupLayouts::TAknPopupLayouts layout = AknPopupLayouts::EMenuWindow; CAknListQueryControl *control = ListControl(); @@ -422,13 +409,12 @@ boxData->SetSkinPopupFrame(&KAknsIIDQsnFrPopup,&KAknsIIDQsnFrPopupCenter); boxData->SetSkinPopupFramePosition(outerRect,innerRect); - _AKNTRACE_FUNC_EXIT; + } EXPORT_C void CAknListQueryDialog::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType) { - _AKNTRACE( "[%s][%s] aEventType: %d", "CAknListQueryDialog", "HandleListBoxEventL", aEventType); if ( AknLayoutUtils::PenEnabled() ) { switch(aEventType) @@ -485,7 +471,6 @@ } } } - _AKNTRACE_FUNC_EXIT; } @@ -521,8 +506,6 @@ EXPORT_C TKeyResponse CAknListQueryDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) { - _AKNTRACE( "[%s][%s] aKeyEvent.iCode: %d", "CAknListQueryDialog", "OfferKeyEventL", aKeyEvent.iCode); - _AKNTRACE( "[%s][%s] aType: %d", "CAknListQueryDialog", "OfferKeyEventL", aType); if (aType==EEventKey && aKeyEvent.iCode == EKeyEscape) { CloseState(); @@ -608,7 +591,6 @@ EXPORT_C TBool CAknListQueryDialog::OkToExitL(TInt aButtonId) { - _AKNTRACE( "[%s][%s] aButtonId: %d", "CAknListQueryDialog", "OkToExitL", aButtonId); CEikListBox* listbox = ListBox(); if(aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk) @@ -636,15 +618,10 @@ for(TInt i(0); iAppendL(array->At(i)); } - _AKNTRACE( "[%s][%s] return ETrue", "CAknListQueryDialog", "OkToExitL"); return ETrue; } else if(aButtonId == GetRightCBAShortKeyPress()) - { - _AKNTRACE( "[%s][%s] return ETrue", "CAknListQueryDialog", "OkToExitL"); - return ETrue; - } - _AKNTRACE( "[%s][%s] return EFalse", "CAknListQueryDialog", "OkToExitL"); + return ETrue; return EFalse; } @@ -659,14 +636,11 @@ EXPORT_C void CAknListQueryDialog::CloseState() { - _AKNTRACE_FUNC_ENTER; TRAP_IGNORE(TryExitL(EAknSoftkeyCancel)); - _AKNTRACE_FUNC_EXIT; } EXPORT_C void CAknListQueryDialog::ActivateL() { - _AKNTRACE_FUNC_ENTER; TBool notShowingPopup = ListBox()->Model()->NumberOfItems() == 0; if (notShowingPopup) { @@ -697,22 +671,45 @@ { CAknQueryDialog::ActivateL(); } - _AKNTRACE_FUNC_EXIT; } TInt CAknListQueryDialog::ClosePopup(TAny *aObj) { - _AKNTRACE_FUNC_ENTER; CAknListQueryDialog *popup = (CAknListQueryDialog*)aObj; delete popup->iIdle; popup->iIdle = 0; popup->CloseState(); - _AKNTRACE_FUNC_EXIT; return EFalse; } EXPORT_C void CAknListQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) { + // list query is dismissed if tapped outside + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + if( !Rect().Contains( aPointerEvent.iPosition ) ) + { + if ( !iIdle ) + { + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if ( feedback ) + { + feedback->InstantFeedback( ETouchFeedbackPopUp ); + } + iIdle = CIdle::NewL(CActive::EPriorityIdle); + iIdle->Start(TCallBack(ClosePopup, this)); + return; + } + } + + TInt index; + if ( ListBox()->View()->XYPosToItemIndex( aPointerEvent.iPosition, index ) ) + { + ListBox()->View()->ItemDrawer()->SetFlags( + CListItemDrawer::EPressedDownState ); + } + } + CAknQueryDialog::HandlePointerEventL( aPointerEvent ); } @@ -724,30 +721,23 @@ TInt CAknListQueryDialog::ClosePopupAcceptingChanges(TAny *aObj) { - _AKNTRACE_FUNC_ENTER; if ( AknLayoutUtils::PenEnabled() ) { CAknListQueryDialog *popup = (CAknListQueryDialog*)aObj; delete popup->iIdle; popup->iIdle = NULL; TRAP_IGNORE( popup->TryExitL( EAknSoftkeyOk ) ); - _AKNTRACE_FUNC_EXIT; return EFalse; } else { - _AKNTRACE_FUNC_EXIT; return EFalse; } } -EXPORT_C void* CAknListQueryDialog::ExtensionInterface( TUid aInterface ) - { - if(aInterface == KExIfTactileFeedbackUid) - { - return MTouchFeedback::Instance(); - } +EXPORT_C void* CAknListQueryDialog::ExtensionInterface( TUid /*aInterface*/ ) + { return NULL; } @@ -781,7 +771,6 @@ EXPORT_C void CAknListQueryDialog::HandleResourceChange(TInt aType) { - _AKNTRACE_FUNC_ENTER; if (aType==KEikDynamicLayoutVariantSwitch) { if (MessageBox()) @@ -789,8 +778,7 @@ MessageBox()->SizeChanged(); } } - CAknQueryDialog::HandleResourceChange(aType); - _AKNTRACE_FUNC_EXIT; + CAknQueryDialog::HandleResourceChange(aType); } EXPORT_C void CAknListQueryDialog::PublishDialogL(TInt aDialogIndex, TUid aCatUid, CArrayFixFlat* aItemIds)