|
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: |
|
15 * Overwrite AknListQueryDialog to provide Imum a working touch dialog. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include "ImumListQueryDialog.h" |
|
21 |
|
22 // ---------------------------------------------------------------------------- |
|
23 // CImumListQueryDialog::CImumListQueryDialog() |
|
24 // ---------------------------------------------------------------------------- |
|
25 // |
|
26 CImumListQueryDialog::CImumListQueryDialog( TInt* aIndex ) |
|
27 : CAknListQueryDialog( aIndex ) |
|
28 { |
|
29 iPreviousIndex = 0; |
|
30 } |
|
31 |
|
32 // ---------------------------------------------------------------------------- |
|
33 // CImumListQueryDialog::~CImumListQueryDialog() |
|
34 // ---------------------------------------------------------------------------- |
|
35 // |
|
36 CImumListQueryDialog::~CImumListQueryDialog() |
|
37 { |
|
38 delete iIdle; |
|
39 } |
|
40 |
|
41 // ---------------------------------------------------------------------------- |
|
42 // CImumListQueryDialog::HandleListBoxEventL() |
|
43 // ---------------------------------------------------------------------------- |
|
44 // |
|
45 void CImumListQueryDialog::HandleListBoxEventL( CEikListBox* aListBox, |
|
46 TListBoxEvent aEventType ) |
|
47 { |
|
48 if ( AknLayoutUtils::PenEnabled() ) |
|
49 { |
|
50 switch(aEventType) |
|
51 { |
|
52 case EEventItemDoubleClicked: |
|
53 case EEventItemClicked: |
|
54 { |
|
55 delete iIdle; |
|
56 iIdle = NULL; |
|
57 iIdle = CIdle::NewL( CActive::EPriorityIdle ); |
|
58 |
|
59 if( iIdle && !aListBox->IsMultiselection() ) |
|
60 { |
|
61 // if current focus is the same as previous focus |
|
62 // then accept selection |
|
63 TInt tempIndex = aListBox->CurrentItemIndex(); |
|
64 |
|
65 if( iPreviousIndex != tempIndex ) |
|
66 { |
|
67 iPreviousIndex = tempIndex; |
|
68 } |
|
69 else |
|
70 { |
|
71 iIdle->Start( TCallBack( ClosePopupAcceptingChanges, this ) ); |
|
72 } |
|
73 } |
|
74 break; |
|
75 } |
|
76 default: |
|
77 { |
|
78 // Default functionality from base class |
|
79 CAknListQueryDialog::HandleListBoxEventL( aListBox, aEventType ); |
|
80 break; |
|
81 } |
|
82 } |
|
83 } |
|
84 else |
|
85 { |
|
86 // Default functionality from base class |
|
87 CAknListQueryDialog::HandleListBoxEventL( aListBox, aEventType ); |
|
88 } |
|
89 } |
|
90 |
|
91 // ---------------------------------------------------------------------------- |
|
92 // CImumListQueryDialog::ClosePopup() |
|
93 // ---------------------------------------------------------------------------- |
|
94 // |
|
95 TInt CImumListQueryDialog::ClosePopup( TAny *aObj ) |
|
96 { |
|
97 CImumListQueryDialog *popup = ( CImumListQueryDialog* )aObj; |
|
98 delete popup->iIdle; |
|
99 popup->iIdle = 0; |
|
100 popup->CloseState(); |
|
101 return EFalse; |
|
102 } |
|
103 |
|
104 // ---------------------------------------------------------------------------- |
|
105 // CImumListQueryDialog::ClosePopupAcceptingChanges() |
|
106 // ---------------------------------------------------------------------------- |
|
107 // |
|
108 TInt CImumListQueryDialog::ClosePopupAcceptingChanges( TAny *aObj ) |
|
109 { |
|
110 if ( AknLayoutUtils::PenEnabled() ) |
|
111 { |
|
112 CImumListQueryDialog *popup = ( CImumListQueryDialog* )aObj; |
|
113 delete popup->iIdle; |
|
114 popup->iIdle = NULL; |
|
115 TRAP_IGNORE( popup->TryExitL( EAknSoftkeyOk ) ); |
|
116 return EFalse; |
|
117 } |
|
118 else |
|
119 { |
|
120 return EFalse; |
|
121 } |
|
122 } |
|
123 |
|
124 // End of File |