|
1 /* |
|
2 * Copyright (c) 2002-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: Global list query dialog implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <uikon.hrh> // EKeyOk |
|
19 #include "AknListQueryNotificationDialog.h" |
|
20 #include "AknNotifyPlugin.hrh" |
|
21 #include "avkon.hrh" |
|
22 |
|
23 CAknListQueryNotificationDialog::CAknListQueryNotificationDialog( |
|
24 TInt* aIndex, |
|
25 MAknListQueryNotificationCallback* aCallBack, |
|
26 CAknListQueryNotificationDialog** aSelfPtr) |
|
27 : CAknListQueryDialog(aIndex), iCallBack(aCallBack), iSelfPtr(aSelfPtr) |
|
28 { |
|
29 } |
|
30 |
|
31 CAknListQueryNotificationDialog::~CAknListQueryNotificationDialog() |
|
32 { |
|
33 if (iSelfPtr) |
|
34 { |
|
35 *iSelfPtr = NULL; |
|
36 } |
|
37 } |
|
38 |
|
39 TKeyResponse CAknListQueryNotificationDialog::OfferKeyEventL( |
|
40 const TKeyEvent& aKeyEvent, |
|
41 TEventCode aType) |
|
42 { |
|
43 if ((iPanning || iFlick) && (aKeyEvent.iCode == EKeyDownArrow || aKeyEvent.iCode == EKeyUpArrow)) |
|
44 { |
|
45 return EKeyWasNotConsumed; |
|
46 } |
|
47 |
|
48 if (aKeyEvent.iScanCode == EStdKeyYes) |
|
49 { |
|
50 return EKeyWasConsumed; |
|
51 } |
|
52 |
|
53 if (aType != EEventKey) |
|
54 { |
|
55 return EKeyWasNotConsumed; |
|
56 } |
|
57 |
|
58 TInt code = aKeyEvent.iCode; |
|
59 |
|
60 switch (code) |
|
61 { |
|
62 case EKeyOK: |
|
63 TryExitL(EAknSoftkeyOk); |
|
64 return EKeyWasConsumed; |
|
65 case EKeyEscape: |
|
66 TryExitL(EAknSoftkeyCancel); |
|
67 return EKeyWasConsumed; |
|
68 default: |
|
69 break; |
|
70 } |
|
71 |
|
72 return CAknListQueryDialog::OfferKeyEventL(aKeyEvent, aType); |
|
73 } |
|
74 |
|
75 void CAknListQueryNotificationDialog::HandleListBoxEventL( |
|
76 CEikListBox* aListBox, |
|
77 TListBoxEvent aEventType) |
|
78 { |
|
79 if (AknLayoutUtils::PenEnabled()) |
|
80 { |
|
81 switch (aEventType) |
|
82 { |
|
83 case EEventPanningStarted: |
|
84 { |
|
85 iPanning = ETrue; |
|
86 } |
|
87 break; |
|
88 case EEventPanningStopped: |
|
89 { |
|
90 iPanning = EFalse; |
|
91 } |
|
92 break; |
|
93 case EEventFlickStarted: |
|
94 { |
|
95 iFlick = ETrue; |
|
96 } |
|
97 break; |
|
98 case EEventFlickStopped: |
|
99 { |
|
100 iFlick = EFalse; |
|
101 } |
|
102 break; |
|
103 default: |
|
104 { |
|
105 break; |
|
106 } |
|
107 } |
|
108 } |
|
109 CAknListQueryDialog::HandleListBoxEventL(aListBox, aEventType); |
|
110 } |
|
111 |
|
112 TBool CAknListQueryNotificationDialog::OkToExitL(TInt aButtonId) |
|
113 { |
|
114 TInt ret = -1; |
|
115 if (aButtonId != EAknSoftkeyCancel) |
|
116 { |
|
117 ret = ListBox()->CurrentItemIndex(); |
|
118 } |
|
119 iCallBack->QueryDismissedL(ret); |
|
120 if (aButtonId == EAknSoftkeyCancel || aButtonId == EAknSoftkeyOk) |
|
121 { |
|
122 return ETrue; |
|
123 } |
|
124 return EFalse; |
|
125 } |
|
126 |
|
127 void CAknListQueryNotificationDialog::CEikDialog_Reserved_1() |
|
128 { |
|
129 } |
|
130 |
|
131 void CAknListQueryNotificationDialog::CEikDialog_Reserved_2() |
|
132 { |
|
133 } |
|
134 |
|
135 void CAknListQueryNotificationDialog::CAknDialog_Reserved() |
|
136 { |
|
137 } |
|
138 |
|
139 void CAknListQueryNotificationDialog::CAknQueryDialog_Reserved() |
|
140 { |
|
141 } |
|
142 |
|
143 // End of file |