|
1 /* |
|
2 * Copyright (c) 2006-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: Definition of the voice verification dialog |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef VUICVERIFICATIONDIALOG_H |
|
19 #define VUICVERIFICATIONDIALOG_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <aknlists.h> |
|
23 #include <aknlistquerydialog.h> |
|
24 #include <AknMediatorObserver.h> |
|
25 |
|
26 #include <secondarydisplay/vuisecondarydisplayapi.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CListQueryDialog; |
|
30 class MKeyCallback; |
|
31 |
|
32 // CONSTANTS |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Voice verification dialog |
|
38 */ |
|
39 NONSHARABLE_CLASS( CVerificationDialog ) : public CCoeControl, |
|
40 public MAknDialogMediatorObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CVerificationDialog* NewL(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CVerificationDialog(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Registers given object as a key listener |
|
58 */ |
|
59 void RegisterForKeyCallback( MKeyCallback* aKeyCallback ); |
|
60 |
|
61 /** |
|
62 * Creates verification query |
|
63 * @param aHeader Optional header text for the list |
|
64 */ |
|
65 void CreateVerificationPopupLC( const TDesC& aHeader ); |
|
66 |
|
67 /** |
|
68 * Shows verification query |
|
69 * @return Key value that caused the dialog to be dismissed |
|
70 */ |
|
71 TInt ShowVerificationPopupL(); |
|
72 |
|
73 /** |
|
74 * Returns selected command based on the selection id. |
|
75 * @param aId Selection id |
|
76 * @return Command id or KErrGeneral |
|
77 */ |
|
78 TInt SelectedCommand( TInt aId ); |
|
79 |
|
80 public: // Functions from base classes |
|
81 |
|
82 /** |
|
83 * From CCoeControl Called when a key is pressed |
|
84 * @see CCoeControl |
|
85 */ |
|
86 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
87 |
|
88 /** |
|
89 * From MAknDialogMediatorObserver |
|
90 * @see MAknDialogMediatorObserver for more information. |
|
91 */ |
|
92 TAknDialogMediatorObserverCommand MediatorCommandL( TUid aDomain, TUid aCategory, |
|
93 TInt aCommandId, |
|
94 const TDesC8& aData ); |
|
95 |
|
96 /** |
|
97 * From MAknDialogMediatorObserver |
|
98 * @see MAknDialogMediatorObserver for more information. |
|
99 */ |
|
100 void NotifyMediatorExit(); |
|
101 |
|
102 private: // New functions |
|
103 |
|
104 /** |
|
105 * Converts key event to one of keypress enumeration values |
|
106 * @param aKeyEvent Original key event |
|
107 * @return One of keypress enumeration values |
|
108 */ |
|
109 TInt ConvertKeyEventL( const TKeyEvent& aKeyEvent ); |
|
110 |
|
111 /** |
|
112 * Sets data for secondary display |
|
113 * @param aData Data to be send to secondary display |
|
114 */ |
|
115 void SetSecondaryDisplayDataL( SecondaryDisplay::TVerificationData& aData ); |
|
116 |
|
117 private: // Constructors |
|
118 |
|
119 /** |
|
120 * C++ default constructor. |
|
121 */ |
|
122 CVerificationDialog(); |
|
123 |
|
124 /** |
|
125 * By default Symbian 2nd phase constructor is private. |
|
126 */ |
|
127 void ConstructL(); |
|
128 |
|
129 private: //data |
|
130 |
|
131 // Dialog |
|
132 CListQueryDialog* iDialog; |
|
133 |
|
134 // Key observer |
|
135 MKeyCallback* iKeyCallback; |
|
136 |
|
137 // Index of currently selected item |
|
138 TInt iCurrentIndex; |
|
139 }; |
|
140 |
|
141 #endif // VUICVERIFICATIONDIALOG_H |
|
142 |
|
143 // End of File |