|
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 #ifndef IMUMLISTQUERYDIALOG_H |
|
20 #define IMUMLISTQUERYDIALOG_H |
|
21 |
|
22 #include <aknlistquerydialog.h> |
|
23 |
|
24 |
|
25 NONSHARABLE_CLASS( CImumListQueryDialog ) : public CAknListQueryDialog |
|
26 { |
|
27 public: |
|
28 /** |
|
29 * C++ default constructor. |
|
30 * |
|
31 * @param aIndex After the query is dismissed, the index will |
|
32 * hold the value of selected item. |
|
33 */ |
|
34 CImumListQueryDialog( TInt* aIndex ); |
|
35 |
|
36 |
|
37 /** |
|
38 * Destructor. |
|
39 */ |
|
40 ~CImumListQueryDialog(); |
|
41 |
|
42 |
|
43 /** |
|
44 * From @c MEikListBoxObserver. |
|
45 * Overwrite CAknListQueryDialog. |
|
46 * |
|
47 * Handles events from listbox. |
|
48 * |
|
49 * @param aListBox The listbox which caused the event. |
|
50 * @param aEventType Type of the event. |
|
51 */ |
|
52 void HandleListBoxEventL( CEikListBox* aListBox, |
|
53 TListBoxEvent aEventType ); |
|
54 |
|
55 private: |
|
56 /** |
|
57 * Overwrite CAknListQueryDialog. |
|
58 * |
|
59 * Closes the dialog. |
|
60 * Gets called by iIdle. |
|
61 * |
|
62 * @param aObj Target dialog to be closed. |
|
63 * @return @c EFalse always. |
|
64 */ |
|
65 static TInt ClosePopup( TAny *aObj ); |
|
66 |
|
67 /** |
|
68 * Overwrite CAknListQueryDialog. |
|
69 * |
|
70 * Closes the dialog and accepts selected item. |
|
71 * Gets called by iIdle. |
|
72 * |
|
73 * @param aObj Target dialog to be closed. |
|
74 * @return @c EFalse always. |
|
75 */ |
|
76 static TInt ClosePopupAcceptingChanges( TAny *aObj ); |
|
77 |
|
78 private: |
|
79 // Will hold the index of the selected item |
|
80 TInt *iIndex; |
|
81 // Was the enter key pressed |
|
82 TBool iEnterKeyPressed; |
|
83 // Idle object to close the query if it there's no items to show |
|
84 CIdle *iIdle; |
|
85 // Holds previous focus index |
|
86 TInt iPreviousIndex; |
|
87 }; |
|
88 |
|
89 #endif // IMUMLISTQUERYDIALOG_H |