|
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: Class implementing CCCAppViewPluginAknContainer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CCAPPCOMMALAUNCHERCONTAINER_H |
|
20 #define __CCAPPCOMMALAUNCHERCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "ccappcommlauncherheaders.h" |
|
24 #include <Pbk2Commands.hrh> |
|
25 #include "ccappstatuscontrol.h" |
|
26 #include <aknlongtapdetector.h> |
|
27 |
|
28 class CAknsBasicBackgroundControlContext; |
|
29 class CAknPreviewPopUpController; |
|
30 class CCCAppCommLauncherPlugin; |
|
31 class CCCAppCommLauncherHeaderControl; |
|
32 class CCCAppCommLauncherPbkCmd; |
|
33 class CCCAppStatusControl; |
|
34 class CPbk2ApplicationServices; |
|
35 class CSpbContentProvider; |
|
36 class MCCAViewLauncher; |
|
37 class CCCAExtensionFactory; |
|
38 class CCCAppCommLauncherCustomListBox; |
|
39 class CCCaFactoryExtensionNotifier; |
|
40 |
|
41 /** |
|
42 * Class implementing CCAppCommLauncher -container for controls |
|
43 * |
|
44 * @code |
|
45 * ?good_class_usage_example(s) |
|
46 * @endcode |
|
47 * |
|
48 * @lib ccappcommlauncherplugin.dll |
|
49 * @since S60 v5.0 |
|
50 */ |
|
51 class CCCAppCommLauncherContainer : |
|
52 public CCCAppViewPluginAknContainer, |
|
53 public MEikListBoxObserver, |
|
54 public MCCAppContactHandlerNotifier, |
|
55 public MCCAStatusControlObserver, |
|
56 public MAknLongTapDetectorCallBack |
|
57 { |
|
58 public: // constructor and destructor |
|
59 |
|
60 /** |
|
61 * CCCAppCommLauncherContainer. |
|
62 * |
|
63 * @param aPlugin reference |
|
64 */ |
|
65 CCCAppCommLauncherContainer( |
|
66 CCCAppCommLauncherPlugin& aPlugin ); |
|
67 |
|
68 /** |
|
69 * ~CCCAppCommLauncherContainer |
|
70 */ |
|
71 virtual ~CCCAppCommLauncherContainer(); |
|
72 |
|
73 public: // Functions from base classes |
|
74 |
|
75 /** |
|
76 * From CCoeControl |
|
77 * (see details from baseclass ) |
|
78 */ |
|
79 void Draw( const TRect& aRect ) const; |
|
80 |
|
81 /** |
|
82 * From CCoeControl |
|
83 * (see details from baseclass ) |
|
84 */ |
|
85 virtual void SizeChanged(); |
|
86 |
|
87 /** |
|
88 * From CCoeControl |
|
89 * (see details from baseclass ) |
|
90 */ |
|
91 TInt CountComponentControls() const; |
|
92 |
|
93 /** |
|
94 * From CCoeControl |
|
95 * (see details from baseclass ) |
|
96 */ |
|
97 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
98 |
|
99 /** |
|
100 * From CCoeControl |
|
101 * (see details from baseclass ) |
|
102 */ |
|
103 TKeyResponse OfferKeyEventL( |
|
104 const TKeyEvent& aKeyEvent, TEventCode aType); |
|
105 |
|
106 /** |
|
107 * From CCoeControl |
|
108 * (see details from baseclass ) |
|
109 */ |
|
110 TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
111 |
|
112 /** |
|
113 * From CCoeControl |
|
114 * (see details from baseclass ) |
|
115 */ |
|
116 void FocusChanged( TDrawNow aDrawNow ); |
|
117 |
|
118 /** |
|
119 * From CCoeControl |
|
120 * (see details from baseclass ) |
|
121 */ |
|
122 void HandlePointerEventL( |
|
123 const TPointerEvent& aPointerEvent ); |
|
124 |
|
125 /** |
|
126 * Default callback function for CAknLongTapDetector member object. |
|
127 * Base class implementation does nothing |
|
128 * |
|
129 * @param aPenEventLocation Long tap event location relative to parent control. |
|
130 * @param aPenEventScreenLocation Long tap event location relative to screen. |
|
131 */ |
|
132 void HandleLongTapEventL( const TPoint& aPenEventLocation, |
|
133 const TPoint& aPenEventScreenLocation ); |
|
134 |
|
135 /** |
|
136 * From MEikListBoxObserver |
|
137 * (see details from baseclass ) |
|
138 */ |
|
139 void HandleListBoxEventL( |
|
140 CEikListBox *aListBox, TListBoxEvent aEventType ); |
|
141 |
|
142 /** |
|
143 * From MCCAppContactHandlerNotifier |
|
144 * (see details from baseclass ) |
|
145 */ |
|
146 void ContactInfoFetchedNotifyL( |
|
147 const CCmsContactFieldInfo& aContactFieldInfo ); |
|
148 |
|
149 /** |
|
150 * From MCCAppContactHandlerNotifier |
|
151 * (see details from baseclass ) |
|
152 */ |
|
153 void ContactFieldFetchedNotifyL( |
|
154 const CCmsContactField& aContactField ); |
|
155 |
|
156 /** |
|
157 * From MCCAppContactHandlerNotifier |
|
158 * (see details from baseclass ) |
|
159 */ |
|
160 void ContactFieldFetchingCompletedL(); |
|
161 |
|
162 /** |
|
163 * From MCCAppContactHandlerNotifier |
|
164 * (see details from baseclass ) |
|
165 */ |
|
166 void ContactsChangedL( /*MVPbkContactLink& aLink*/ ); |
|
167 |
|
168 /** |
|
169 * From MCCAppContactHandlerNotifier |
|
170 * (see details from baseclass ) |
|
171 */ |
|
172 void ContactPresenceChangedL( const CCmsContactField& aContactField ); |
|
173 |
|
174 /** |
|
175 * From CCoeControl |
|
176 * (see details from baseclass ) |
|
177 */ |
|
178 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
179 |
|
180 /** |
|
181 * From MCCAStatusControlObserver |
|
182 */ |
|
183 void StatusClickedL(); |
|
184 |
|
185 public: // New |
|
186 |
|
187 /** |
|
188 * Getter for plugin reference. |
|
189 * |
|
190 * @return Plugin reference |
|
191 * @since S60 v5.0 |
|
192 */ |
|
193 CCCAppCommLauncherPlugin& Plugin(); |
|
194 |
|
195 /** |
|
196 * To check whether there are communication methods available |
|
197 * |
|
198 * @return ETrue if available, otherwise EFalse |
|
199 * @since S60 v5.0 |
|
200 */ |
|
201 TBool CommMethodsAvailable(); |
|
202 |
|
203 /** |
|
204 * Getter for currently selected comm method. |
|
205 * |
|
206 * @return contact action |
|
207 * @since S60 v5.0 |
|
208 */ |
|
209 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector SelectedCommunicationMethod(); |
|
210 |
|
211 private: // New |
|
212 |
|
213 /** |
|
214 * Creates the listbox part and model for it |
|
215 * |
|
216 * @since S60 v5.0 |
|
217 */ |
|
218 void CreateListboxControlL(); |
|
219 |
|
220 /** |
|
221 * Updates the number/address popup |
|
222 */ |
|
223 void UpdatePopupL(); |
|
224 |
|
225 /** |
|
226 * Helper function for determining text truncation direction for the preview popup |
|
227 * |
|
228 * @param aContactAction The communication method |
|
229 */ |
|
230 AknTextUtils::TClipDirection MapCommMethodToClipDirection( |
|
231 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aContactAction ); |
|
232 |
|
233 /** |
|
234 * Calls map commands |
|
235 * |
|
236 * @param aCommandId Command id |
|
237 */ |
|
238 void DoShowMapCmdL( TPbk2CommandId aCommandId ); |
|
239 |
|
240 /** |
|
241 * Long tap detector |
|
242 * |
|
243 * @param none |
|
244 */ |
|
245 CAknLongTapDetector& LongTapDetectorL(); |
|
246 /* |
|
247 * Gets called when ExtensionFactory plugin is installed/removed |
|
248 */ |
|
249 static TInt CheckExtensionFactoryL(TAny* aPtr); |
|
250 |
|
251 /* |
|
252 * Hides/shows the status control based on Extensionfactory plugins |
|
253 * availability. |
|
254 */ |
|
255 void DoCheckExtensionFactoryL(); |
|
256 |
|
257 private: // Constructors |
|
258 |
|
259 /** |
|
260 * ConstructL |
|
261 */ |
|
262 void ConstructL(); |
|
263 |
|
264 private: // Data |
|
265 |
|
266 /** |
|
267 * Control showing the header part of the view |
|
268 * Own. |
|
269 */ |
|
270 CCCAppCommLauncherHeaderControl* iHeaderCtrl; |
|
271 |
|
272 /** |
|
273 * Control to show the status icon and the text |
|
274 */ |
|
275 CCCAppStatusControl* iStatusControl; |
|
276 |
|
277 /** |
|
278 * Listbox for the "communication buttons" |
|
279 * Own. |
|
280 */ |
|
281 // CCCAppCommLauncherCustomListBox* iListBox; |
|
282 CAknDoubleLargeStyleListBox* iListBox; |
|
283 /** |
|
284 * Background for skinning |
|
285 * Own. |
|
286 */ |
|
287 CAknsBasicBackgroundControlContext* iBackground; |
|
288 |
|
289 /** |
|
290 * Ref to plugin. |
|
291 * Not own. |
|
292 */ |
|
293 CCCAppCommLauncherPlugin& iPlugin; |
|
294 /** |
|
295 * Model containing the launchpad data |
|
296 * Own. |
|
297 */ |
|
298 CCCAppCommLauncherLPadModel* iModel; |
|
299 |
|
300 /** |
|
301 * Indicates if focus has been dragged around the list, helps with single tap launching |
|
302 */ |
|
303 TBool iHasBeenDragged; |
|
304 |
|
305 /** |
|
306 * Number of rows in model |
|
307 */ |
|
308 TInt iMdlRowCount; |
|
309 |
|
310 /** |
|
311 * Command handler |
|
312 * Own. |
|
313 */ |
|
314 CCCAppCommLauncherPbkCmd* iPbkCmd; |
|
315 |
|
316 /** |
|
317 * AppServices |
|
318 * Not owned |
|
319 */ |
|
320 CPbk2ApplicationServices* iAppServices; |
|
321 |
|
322 /** |
|
323 * Used for launching the Ecom plugins |
|
324 * Own. |
|
325 */ |
|
326 MCCAViewLauncher* iViewLauncher; |
|
327 |
|
328 /** |
|
329 * ContentProvider |
|
330 * Own. |
|
331 */ |
|
332 CSpbContentProvider* iProvider; |
|
333 |
|
334 /** |
|
335 * iLongTapDetector |
|
336 * Own. |
|
337 */ |
|
338 CAknLongTapDetector* iLongTapDetector; |
|
339 |
|
340 /* |
|
341 * Used for hiding/showing the StatusControl |
|
342 * Own. |
|
343 */ |
|
344 CCCaFactoryExtensionNotifier* iFactoryExtensionNotifier; |
|
345 }; |
|
346 |
|
347 #endif // __CCAPPCOMMALAUNCHERCONTAINER_H |
|
348 |
|
349 // End of File |