|
1 /* |
|
2 * Copyright (c) 2005 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: Pbk info view dialog. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PBKINFOVIEWDIALOG_H |
|
20 #define PBKINFOVIEWDIALOG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <eikdialg.h> |
|
25 #include <eiklbo.h> |
|
26 #include <aknlists.h> |
|
27 #include <AknDialog.h> |
|
28 #include <aknnavi.h> |
|
29 #include <AknInfoPopupNoteController.h> |
|
30 |
|
31 #include "pbkinfoviewdialogutil.h" |
|
32 #include "pbkinfoviewreshandler.h" |
|
33 #include "pbkinfoviewsindhandler.h" |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class TXspIconHelper; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Pbk info view dialog. |
|
42 */ |
|
43 NONSHARABLE_CLASS (CPbkInfoViewDialog) : public CAknDialog, public MEikListBoxObserver |
|
44 { |
|
45 enum TInfoViewDialogIconIndex |
|
46 { |
|
47 EIconIndexPhone = 0, |
|
48 EIconIndexMobile, |
|
49 EIconIndexVideo, |
|
50 EIconIndexVoip, |
|
51 EIconIndexEmail, |
|
52 EIconIndexEmpty |
|
53 }; |
|
54 |
|
55 public:// Constructors and destructor |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 */ |
|
60 static CPbkInfoViewDialog* NewL( TInt aContactId ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CPbkInfoViewDialog(); |
|
66 |
|
67 public: |
|
68 |
|
69 /** |
|
70 * Overrides CAknDialog::ExecuteLD. Checks whether the contact has any |
|
71 * voice tags. If not an info note is displayed. Otherwise calls |
|
72 * CAknDialog::ExecuteLD |
|
73 * @param aResourceId The resource ID of the dialog to be loaded |
|
74 * @return see CAknDialog::ExecuteLD |
|
75 */ |
|
76 TInt ExecuteLD( TInt aResourceId ); |
|
77 |
|
78 /** |
|
79 * Responds to a change in focus. |
|
80 * |
|
81 * @param aDrawNow Contains the value that was passed to it by |
|
82 * @c SetFocus(). |
|
83 */ |
|
84 void FocusChanged(TDrawNow aDrawNow); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * C++ default constructor. |
|
90 */ |
|
91 CPbkInfoViewDialog( TInt aContactId ); |
|
92 |
|
93 /** |
|
94 * By default Symbian OS constructor is private. |
|
95 */ |
|
96 void ConstructL(); |
|
97 |
|
98 private: |
|
99 |
|
100 /** |
|
101 * Called by framework before the dialog is shown. |
|
102 * @param None |
|
103 * @return None |
|
104 */ |
|
105 void PostLayoutDynInitL(); |
|
106 |
|
107 /** |
|
108 * Called by framework after the dialog is shown. |
|
109 * @param None |
|
110 * @return None |
|
111 */ |
|
112 void PreLayoutDynInitL(); |
|
113 |
|
114 /** |
|
115 * Handles menu events. |
|
116 * @param aCommandId Command id. |
|
117 * @return None. |
|
118 */ |
|
119 void ProcessCommandL( TInt aCommandId ); |
|
120 |
|
121 /** |
|
122 * From the base class. |
|
123 * Called by framework for key event handling. |
|
124 * @param aKeyEvent. |
|
125 * @param TEventCode. |
|
126 * @return Return code. |
|
127 */ |
|
128 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType ); |
|
129 |
|
130 /** |
|
131 * From the base class. |
|
132 * Called by framework before exiting the dialog. |
|
133 * @param Button id. |
|
134 * @return ETrue to exit\ EFalse to not to exit. |
|
135 */ |
|
136 TBool OkToExitL(TInt aButtonId); |
|
137 |
|
138 /** |
|
139 * From the base class. |
|
140 * Called by framework before menu is shown. |
|
141 * @param aResourceId Menu resource id. |
|
142 * @param aMenuPane Pointer to the menu. |
|
143 * @return None. |
|
144 */ |
|
145 void DynInitMenuPaneL( TInt aResourceID, CEikMenuPane* aMenuPane ); |
|
146 |
|
147 /** |
|
148 * From the base class. |
|
149 * Called when dialog is activated. |
|
150 * @return None. |
|
151 */ |
|
152 void ActivateL(); |
|
153 |
|
154 /** |
|
155 * Method to get context sensitive help topic. |
|
156 * @param aContext Help topic to open. |
|
157 * @return None. |
|
158 */ |
|
159 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
160 |
|
161 /** |
|
162 * Called when display resolution changes. |
|
163 * @param aType. |
|
164 * @return None. |
|
165 */ |
|
166 void HandleResourceChange( TInt aType ); |
|
167 |
|
168 /** |
|
169 * Updates dialog cba. |
|
170 * @param aResourceId Resource id. |
|
171 * @return None. |
|
172 */ |
|
173 void UpdateCbaL( TInt aResourceId ); |
|
174 |
|
175 /** |
|
176 * Returns TInfoViewDialogIconIndex enumeration icon index. |
|
177 * @param aIconId enumeration TPbkIconId from PbkIconId.hrh. |
|
178 * aTagIndex voice tag index |
|
179 * @return Icon index. |
|
180 */ |
|
181 TInt IconIndex( TInt aIconId,TInt aTagIndex ); |
|
182 |
|
183 /** |
|
184 * Creates listbox items. |
|
185 * @return None. |
|
186 */ |
|
187 void CreateListBoxItemsL(); |
|
188 |
|
189 /** |
|
190 * Shows popup for a voice command in the list. |
|
191 * @return None. |
|
192 */ |
|
193 void ShowPopupL(); |
|
194 |
|
195 /** |
|
196 * Gets current listbox item. |
|
197 * @param None. |
|
198 * @return Current listbox item index. |
|
199 */ |
|
200 TInt CurrentItemIndex(); |
|
201 |
|
202 /** |
|
203 * Displays an information note |
|
204 * @param aResourceId Id for the resource text to be shown |
|
205 */ |
|
206 void ShowInformationNoteL( TInt aResourceId ); |
|
207 |
|
208 /** |
|
209 * Check if call is ongoing |
|
210 */ |
|
211 TBool IsCallActive(); |
|
212 |
|
213 /** |
|
214 * Show "Call in progress" note |
|
215 */ |
|
216 void CallInProgressNoteL(); |
|
217 |
|
218 /** |
|
219 * Create field icons |
|
220 */ |
|
221 void CreateFieldIconsL(CArrayPtr<CGulIcon>* aIconArray); |
|
222 |
|
223 private: // from MEikListBoxObserver |
|
224 /** |
|
225 * From MEikListBoxObserver, called by framework. |
|
226 * @param aListBox. |
|
227 * @param aEventType. |
|
228 * @return None |
|
229 */ |
|
230 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
231 |
|
232 private: |
|
233 |
|
234 // Id of the contact in contacts db |
|
235 TInt iContactId; |
|
236 |
|
237 // Contact is on sim or mmc card and has no voice tags |
|
238 TBool iVoiceTaglessContact; |
|
239 |
|
240 // Id of the dialog mode |
|
241 TInt iDialogMode; |
|
242 |
|
243 // List of voice commands, does not take ownership |
|
244 CAknDoubleGraphicStyleListBox* iListBox; |
|
245 |
|
246 // For title and icon handling |
|
247 CStatusPaneHandler* iStatusPaneHandler; |
|
248 |
|
249 // For hiding tabs, does not take ownership |
|
250 CAknNavigationControlContainer* iNaviPane; |
|
251 |
|
252 // Popup controller |
|
253 CAknInfoPopupNoteController* iPopupController; |
|
254 |
|
255 // Resource handler |
|
256 CPbkInfoViewResHandler* iResHandler; |
|
257 |
|
258 // Currently selected listbox item |
|
259 TInt iCurrentListBoxIndex; |
|
260 |
|
261 // SIND handler |
|
262 CPbkInfoViewSindHandler* iSindHandler; |
|
263 |
|
264 //XSp icon helper |
|
265 RArray<TXspIconHelper> iXspIconHelper; |
|
266 }; |
|
267 |
|
268 #endif // PBKINFOVIEWDIALOG_H |
|
269 |
|
270 // End of File |