|
1 /* |
|
2 * Copyright (c) 2002 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: Declares container control for application. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef SPDIACONTAINER_H |
|
24 #define SPDIACONTAINER_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <aknview.h> |
|
28 #include <AknUtils.h> |
|
29 #include <eiklbo.h> |
|
30 #include <MPbkContactDbObserver.h> |
|
31 #include "centralrepository.h" |
|
32 #include <aknlongtapdetector.h> |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 //class CAknGrid; |
|
36 class CAknQdialStyleGrid; |
|
37 class CSpdiaView; |
|
38 class CPbkContactChangeNotifier; |
|
39 class CSpeedDialPrivate; |
|
40 class TSpdiaIndexData; |
|
41 class CSpdiaNoteDialog; |
|
42 class CVPbkContactManager; |
|
43 class CPNGNumberGrouping; |
|
44 class CAknLongTapDetector; |
|
45 // CLASS DECLARATION |
|
46 |
|
47 class MRefreshObserver |
|
48 { |
|
49 public: // Interface |
|
50 virtual void RefreshDialog() = 0; |
|
51 }; |
|
52 |
|
53 /** |
|
54 * Generic Speeddial container class. |
|
55 * Container's task is to dispatch key presses to an application-side |
|
56 * key event handler. If key event is not processed application-side, |
|
57 * it is passed to the contained control. |
|
58 * |
|
59 * @since |
|
60 */ |
|
61 |
|
62 class CSpdiaContainer : public CCoeControl, |
|
63 public MPbkContactDbObserver, |
|
64 public MAknLongTapDetectorCallBack, |
|
65 public MRefreshObserver, |
|
66 public MEikListBoxObserver |
|
67 { |
|
68 public: // Constructors and destructor |
|
69 |
|
70 /** |
|
71 * C++ default constructor. |
|
72 */ |
|
73 CSpdiaContainer(CSpeedDialPrivate *aSpeedPrivate); |
|
74 |
|
75 /** |
|
76 * Symbian second phase Constructor. |
|
77 * @param aView Frame pointer. |
|
78 */ |
|
79 void ConstructL(CAknView* aView); |
|
80 |
|
81 /** |
|
82 * Virtual C++ destructor. |
|
83 */ |
|
84 virtual ~CSpdiaContainer(); |
|
85 |
|
86 /** |
|
87 * From CAknContainer takes care of skin changes. |
|
88 * @param aType skin event identifier. |
|
89 */ |
|
90 void HandleResourceChange(TInt aType); |
|
91 |
|
92 public: // New functions |
|
93 /** |
|
94 * Gets the grid data control of speeddial. |
|
95 * @return reference of spdctrl |
|
96 */ |
|
97 CSpeedDialPrivate& Control(); |
|
98 |
|
99 /** |
|
100 * Returns whether the cell position is a VoiceMailBox number or not. |
|
101 * @param aIndex index number |
|
102 * @return ETrue: On VoiceMail Box number |
|
103 */ |
|
104 TBool IsVoiceMailBox(TInt aIndex = -1) const; |
|
105 TBool IsVdoMailBox(TInt aIndex = -1) const; |
|
106 |
|
107 /** |
|
108 * Gets the current position of the grid. |
|
109 * @return Grid position |
|
110 */ |
|
111 TInt CurGridPosition() const; |
|
112 |
|
113 /** |
|
114 * Redraws and renfreshes the grid data. |
|
115 */ |
|
116 void UpdatePhoneNumberL(TInt aIndex = -1); |
|
117 |
|
118 /** |
|
119 * Get resource id on grid position |
|
120 */ |
|
121 TInt MenuResourceID(); |
|
122 |
|
123 /** |
|
124 * Selection of the MiddleSoftKey |
|
125 * |
|
126 */ |
|
127 void MiddleSoftKeyL(); |
|
128 |
|
129 /** |
|
130 * Shows the ViewNumber note. |
|
131 */ |
|
132 void ShowViewNumberL(); |
|
133 |
|
134 /** |
|
135 * Redraws and renfreshes the ViewNumber note. |
|
136 */ |
|
137 void DoUpdateL(); |
|
138 |
|
139 /** |
|
140 * Gets the pointer of the grid control. |
|
141 * @return point of gird control. |
|
142 */ |
|
143 CAknQdialStyleGrid* Grid(); |
|
144 |
|
145 /* Activating the animation in |
|
146 * the background for grid |
|
147 */ |
|
148 void FocusChanged(TDrawNow aDrawNow); |
|
149 |
|
150 /** |
|
151 * Set status pane to the normal status. |
|
152 */ |
|
153 void SetStatusPaneL(); |
|
154 |
|
155 /** |
|
156 * Check whether the view note is displaying when making speeddial to background. |
|
157 */ |
|
158 CSpdiaNoteDialog* GetViewDialogStatus(); |
|
159 |
|
160 public: // Functions from CCoeControl classes |
|
161 /** |
|
162 * This function is called when Help application is launched. |
|
163 * @param aContex |
|
164 */ |
|
165 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
166 |
|
167 /** |
|
168 * This function is called from Spdiaview once the application comes |
|
169 to foreground. |
|
170 */ |
|
171 void RefreshGrid(); |
|
172 /** |
|
173 * Sets true when voice mail box dialog launched |
|
174 * sets false dialog destroyed. |
|
175 * @param aBool |
|
176 */ |
|
177 void VoiceMailDialogLaunched( TBool aBool ); |
|
178 |
|
179 |
|
180 CAknLongTapDetector& LongTapDetectorL(); |
|
181 /** |
|
182 * refresh the dialog in speeddial view |
|
183 */ |
|
184 void RefreshDialog(); |
|
185 public: // Functions from base classes |
|
186 |
|
187 private: // New function |
|
188 |
|
189 |
|
190 /** |
|
191 * Call create by current number |
|
192 */ |
|
193 void CallCreateL(); |
|
194 |
|
195 /** |
|
196 * Creats image from thumbnail. |
|
197 */ |
|
198 CEikImage* CreateBitmapL(const CGulIcon& aSrc); |
|
199 |
|
200 private: // Functions from base classes |
|
201 /** |
|
202 * From CoeControl,SizeChanged. |
|
203 */ |
|
204 void SizeChanged(); |
|
205 |
|
206 /** |
|
207 * From CoeControl,CountComponentControls. |
|
208 */ |
|
209 TInt CountComponentControls() const; |
|
210 |
|
211 /** |
|
212 * From CCoeControl,ComponentControl. |
|
213 */ |
|
214 CCoeControl* ComponentControl(TInt aIndex) const; |
|
215 |
|
216 /** |
|
217 * From CCoeControl,Draw. |
|
218 */ |
|
219 void Draw(const TRect& aRect) const; |
|
220 |
|
221 /** |
|
222 * From CCoeControl processing of a key event |
|
223 */ |
|
224 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
225 |
|
226 /** |
|
227 * From CCoeControl,HandlePointerEventL. |
|
228 */ |
|
229 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
230 /** |
|
231 * From MContactDbObserver, Handles an event of type aEventType. |
|
232 */ |
|
233 void HandleDatabaseEventL(TContactDbObserverEvent aEvent); |
|
234 |
|
235 /** |
|
236 * Returns scaled CEikImage pointer |
|
237 * @param selected icon. |
|
238 */ |
|
239 CEikImage* CreateScaledBitmapL(const CGulIcon& aSrc); |
|
240 |
|
241 public: |
|
242 /** |
|
243 * From MAknLongTapDetectorCallBack |
|
244 * |
|
245 */ |
|
246 void HandleLongTapEventL( const TPoint& aPenEventLocation, |
|
247 const TPoint& aPenEventScreenLocation ); |
|
248 |
|
249 /** |
|
250 * From MEikListBoxObserver, Handles an event of listbox. |
|
251 */ |
|
252 void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
253 private: |
|
254 |
|
255 void SetLayoutL(); |
|
256 |
|
257 private: //data |
|
258 CAknQdialStyleGrid* iGrid; // owned by this |
|
259 CSpdiaView* iView; |
|
260 CSpeedDialPrivate* iSpeedPrivate; // owned by this |
|
261 CVPbkContactManager *iContactManager; |
|
262 CSpdiaNoteDialog* iDialog; // owned by this |
|
263 TBool iNeedUpdate; |
|
264 |
|
265 CPNGNumberGrouping* iNumberGrouping; |
|
266 TBool iVoiceDialog; |
|
267 TBool iAlreadyActive; |
|
268 CAknLongTapDetector* iLongTapDetector; |
|
269 CRepository* ivmbxvariation; |
|
270 TInt iVmbxsupported; |
|
271 |
|
272 TBool iLongTapUsed; |
|
273 |
|
274 // Indicator for the note: no assigned number shown |
|
275 TBool iNoAssignedShown; |
|
276 |
|
277 // Grid index in which the button down |
|
278 TInt iButton1DownIndex; |
|
279 }; |
|
280 |
|
281 #endif // SPDIACONTAINER_H |
|
282 |
|
283 // End of File |