author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:16:29 +0300 | |
branch | RCL_3 |
changeset 34 | e7f34e614544 |
parent 29 | 9a48e301e94b |
permissions | -rw-r--r-- |
29 | 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: tabbed view control implementation class with doublestyle listbox |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef __CVIMPSTUIDOUBLELISTBOXTABVIEWCONTROL_H |
|
19 |
#define __CVIMPSTUIDOUBLELISTBOXTABVIEWCONTROL_H |
|
20 |
||
21 |
#include "mvimpstuitabbedviewcontrol.h" |
|
22 |
#include "mvimpstprocessArrayobserver.h" |
|
23 |
#include "cvimpstuidoublestylelistbox.h" |
|
24 |
||
25 |
class CVIMPSTUiDoubleStyleListBox; |
|
26 |
||
27 |
// CLASS DECLARATION |
|
28 |
/** |
|
29 |
* Tabbed view control. Shows list of contacts. |
|
30 |
* @lib vimpstui.lib |
|
31 |
* @since S60 v5.0 |
|
32 |
*/ |
|
33 |
class CVIMPSTUiDoubleListBoxTabViewControl :public CCoeControl, |
|
34 |
public MVIMPSTProcessArrayObserver, |
|
35 |
public MEikListBoxObserver, |
|
36 |
public MCoeControlObserver, |
|
37 |
public MVIMPSTUiTabbedViewControl |
|
38 |
{ |
|
39 |
public: // Constructor and destructor |
|
40 |
/** |
|
41 |
* Creates a new CImContactsTabbedViewControl. |
|
42 |
* |
|
43 |
* @param aTabbedView reference to view. |
|
44 |
* @param aKeyEventHandler Key event handler to be used |
|
45 |
* @param aCommandHandler reference to commandhandler |
|
46 |
* @param aServiceId Id of the service |
|
47 |
* @param aBrandHandler reference to brandhandler |
|
48 |
* @param aEngine reference to engine |
|
49 |
*/ |
|
50 |
static CVIMPSTUiDoubleListBoxTabViewControl* NewL( CVIMPSTUiTabbedView& aTabbedView, MPbk2KeyEventHandler* aKeyEventHandler, |
|
51 |
MVIMPSTCmdHandler& aCommandHandler, |
|
52 |
TUint32 aServiceId, |
|
53 |
CVIMPSTUiBrandData& aBrandHandler, |
|
34
e7f34e614544
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
54 |
MVIMPSTEngine& aEngine ); |
29 | 55 |
|
56 |
/** |
|
57 |
* Creates a new CImContactsTabbedViewControl and leaves it to |
|
58 |
* cleanup stack. |
|
59 |
* @see NewL |
|
60 |
* |
|
61 |
* @param aTabbedView reference to view. |
|
62 |
* @param aKeyEventHandler Key event handler to be used |
|
63 |
* @param aCommandHandler reference to commandhandler |
|
64 |
* @param aServiceId Id of the service |
|
65 |
* @param aBrandHandler reference to brandhandler |
|
66 |
* @param aEngine reference to engine |
|
67 |
*/ |
|
68 |
static CVIMPSTUiDoubleListBoxTabViewControl* NewLC( CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, |
|
69 |
MVIMPSTCmdHandler& aCommandHandler, |
|
70 |
TUint32 aServiceId, |
|
71 |
CVIMPSTUiBrandData& aBrandHandler, |
|
34
e7f34e614544
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
72 |
MVIMPSTEngine& aEngine ); |
29 | 73 |
|
74 |
/** |
|
75 |
* Destructor. |
|
76 |
*/ |
|
77 |
~CVIMPSTUiDoubleListBoxTabViewControl(); |
|
78 |
||
79 |
public : // from MIMArrayProcessObserver |
|
80 |
/** |
|
81 |
* @see MIMArrayProcessObserver. |
|
82 |
*/ |
|
83 |
void HandleAdditionL(TVIMPSTEnums::TItem type, TInt aIndex); |
|
84 |
||
85 |
/** |
|
86 |
* @see MIMArrayProcessObserver. |
|
87 |
*/ |
|
88 |
void HandleDeletionL(TVIMPSTEnums::TItem type, TInt aIndex); |
|
89 |
/** |
|
90 |
* @see MIMArrayProcessObserver. |
|
91 |
*/ |
|
92 |
void HandleAvatarChangeL( const TDesC& aUserId ); |
|
93 |
||
94 |
public://from MEikListBoxObserver |
|
95 |
||
96 |
/** |
|
97 |
* From MEikListBoxObserver, Handles event's generated by listbox |
|
98 |
* @see MEikListBoxObserver |
|
99 |
*/ |
|
100 |
void HandleListBoxEventL( CEikListBox* aListBox, |
|
101 |
TListBoxEvent aEventType ); |
|
102 |
||
103 |
public: //from MCoeControlObserver |
|
104 |
/** |
|
105 |
* Handles events from findpane and forwards them to listbox filter. |
|
106 |
* @see MCoeControlObserver |
|
107 |
*/ |
|
108 |
void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ); |
|
109 |
||
110 |
||
111 |
/** |
|
112 |
* Get access to listbox model's filter |
|
113 |
* @return model's filter |
|
114 |
*/ |
|
115 |
CAknListBoxFilterItems* ListFilter(); |
|
116 |
||
117 |
||
118 |
public: // New functions |
|
119 |
||
120 |
/** |
|
121 |
* Returns the currently focused item's index. |
|
122 |
* @return TInt, current item index. |
|
123 |
*/ |
|
124 |
TInt CurrentItemIndex() const; |
|
125 |
||
126 |
/** |
|
127 |
* Sets the currently focused item's index. |
|
128 |
* |
|
129 |
* @param aIndex new currently focused index |
|
130 |
*/ |
|
131 |
void SetCurrentItemIndex( TInt aIndex ); |
|
132 |
||
133 |
/** |
|
134 |
* Sets the currently focused item's index and updates the control |
|
135 |
* on the display. |
|
136 |
* |
|
137 |
* @param aIndex new currently focused index |
|
138 |
*/ |
|
139 |
void SetCurrentItemIndexAndDraw( TInt aIndex ); |
|
140 |
||
141 |
/** |
|
142 |
* Handles item addition for this control. |
|
143 |
*/ |
|
144 |
void HandleItemAdditionL(); |
|
145 |
||
146 |
/** |
|
147 |
* Handles item removal for this control. |
|
148 |
*/ |
|
149 |
void HandleItemRemovalL(); |
|
150 |
||
151 |
/** |
|
152 |
* Sets list box empty text. |
|
153 |
* |
|
154 |
* @param aResourceId resource id of a empty text |
|
155 |
*/ |
|
156 |
void SetListEmptyTextL( TInt aResourceId ); |
|
157 |
||
158 |
/** |
|
159 |
* send the message using selected item |
|
160 |
* this will launch the conversation view if im is enabled. |
|
161 |
*/ |
|
162 |
void SendMessageL(); |
|
163 |
||
164 |
/** |
|
165 |
* Updates view after edit. |
|
166 |
* @param aIndex is the index of item that has changed. |
|
167 |
* @param aType is list item type. |
|
168 |
*/ |
|
169 |
void UpdateViewL( TInt aIndex, TVIMPSTEnums::TItem aType); |
|
170 |
||
171 |
||
172 |
/** |
|
173 |
* @see MVIMPSTUiTabbedViewControl. |
|
174 |
*/ |
|
175 |
void HandleAvatarRefreshL( const TDesC& aUserId,TBool aBlock); |
|
176 |
||
177 |
||
178 |
||
179 |
/** |
|
180 |
* LoadsBitmap array. |
|
181 |
*/ |
|
182 |
void LoadBitmapsL(); |
|
183 |
||
184 |
||
185 |
||
186 |
/** |
|
187 |
* Gets the owned listbox control |
|
188 |
* |
|
189 |
* @return the owned list box |
|
190 |
*/ |
|
191 |
CVIMPSTUiDoubleStyleListBox& ListBox() const; |
|
192 |
||
193 |
/** |
|
194 |
* Activates find-pane |
|
195 |
*/ |
|
196 |
void ActivateFindPaneL(); |
|
197 |
||
198 |
/** |
|
199 |
* De-activates find-pane |
|
200 |
*/ |
|
201 |
void DeactivateFindPaneL(); |
|
202 |
||
203 |
/** |
|
204 |
*Handle the avatar deletion in UI |
|
205 |
*/ |
|
206 |
void SetFocussedId(const TDesC& aContact) ; |
|
207 |
||
208 |
/** |
|
209 |
* the avatar deletion in UI |
|
210 |
*/ |
|
211 |
TPtrC GetFocussedId() ; |
|
212 |
||
213 |
private: // From CCoeControl, standard control functionality |
|
214 |
||
215 |
/** |
|
216 |
* @see CCoeControl |
|
217 |
*/ |
|
218 |
TKeyResponse OfferKeyEventL |
|
219 |
( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
220 |
||
221 |
/** |
|
222 |
* @see CCoeControl |
|
223 |
*/ |
|
224 |
void SizeChanged(); |
|
225 |
||
226 |
/** |
|
227 |
* @see CCoeControl |
|
228 |
*/ |
|
229 |
TInt CountComponentControls() const; |
|
230 |
||
231 |
/** |
|
232 |
* @see CCoeControl |
|
233 |
*/ |
|
234 |
CCoeControl* ComponentControl( TInt aIndex ) const; |
|
235 |
||
236 |
/** |
|
237 |
* @see CCoeControl |
|
238 |
*/ |
|
239 |
void FocusChanged( TDrawNow aDrawNow ); |
|
240 |
||
241 |
||
242 |
private: // Implementation |
|
243 |
/** |
|
244 |
* Standard C++ constructor |
|
245 |
* |
|
246 |
* @param aTabbedView reference to view. |
|
247 |
* @param aKeyEventHandler Key event handler to be used |
|
248 |
* @param aCommandHandler reference to commandhandler |
|
249 |
* @param aServiceId Id of the service |
|
250 |
* @param aBrandHandler reference to brandhandler |
|
251 |
* @param aEngine reference to engine |
|
252 |
*/ |
|
253 |
CVIMPSTUiDoubleListBoxTabViewControl( CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, |
|
254 |
MVIMPSTCmdHandler& aCommandHandler, |
|
255 |
TUint32 aServiceId, |
|
256 |
CVIMPSTUiBrandData& aBrandHandler, |
|
34
e7f34e614544
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
257 |
MVIMPSTEngine& aEngine ); |
29 | 258 |
|
259 |
/** |
|
260 |
* Performs the 2nd phase of construction. |
|
261 |
* |
|
262 |
*/ |
|
263 |
void ConstructL(); |
|
264 |
||
265 |
/** |
|
266 |
* Layouts current components according to AVKON LAF |
|
267 |
*/ |
|
268 |
void SetLayout(); |
|
269 |
||
270 |
/** |
|
271 |
* NOTE : PASSING NULL DESCRIPTOR IS NOT ALLOWED |
|
272 |
* NO CHECK FOR THE NULL DESCPRIPTOR |
|
273 |
* |
|
274 |
* Utility function to create Icons from |
|
275 |
* image data using Image processor |
|
276 |
* |
|
277 |
* @param aAvatarContent : avatar content |
|
278 |
* |
|
279 |
* @return CGulIcon icon created , returns NULL in case of errors |
|
280 |
*/ |
|
281 |
CGulIcon* AvatarToIconL( const TDesC8& aAvatarContent ); |
|
282 |
||
283 |
||
284 |
void SetFocusAndMakeItemVisible(); |
|
285 |
||
286 |
public: |
|
287 |
||
288 |
/** |
|
289 |
* Sets the iClrFindPaneFlag |
|
290 |
*/ |
|
291 |
void SetClrFindPaneFlag(TBool aFlag); |
|
292 |
||
293 |
/** |
|
294 |
* Checks if the last contact is focused and Sets the iLastItemFlag |
|
295 |
*/ |
|
296 |
void CheckAndSetLastItemFlag(); |
|
297 |
||
298 |
/** |
|
299 |
* returns the CCoeControl* pointer |
|
300 |
*/ |
|
301 |
CCoeControl* CoeControl(); |
|
302 |
||
303 |
/** |
|
304 |
* Sets the lock status of softkeys |
|
305 |
* @param aLock new status of lock (ETrue: locked, EFalse: Unlocked) |
|
306 |
*/ |
|
307 |
void SetCbaLockL( TBool aLock ); |
|
308 |
||
309 |
/** |
|
310 |
* Updates Softkeys according to current focus |
|
311 |
* @param aUseDefaultCba Flag to force the default sofkeys for view. |
|
312 |
* Default value is false. |
|
313 |
*/ |
|
314 |
void UpdateCbaL( TBool aUseDefaultCba = EFalse ); |
|
315 |
||
316 |
||
317 |
private: // Data |
|
318 |
||
319 |
// not owned |
|
320 |
CVIMPSTUiTabbedView& iTabbedView; |
|
321 |
||
322 |
// Not owned: key event handler |
|
323 |
MPbk2KeyEventHandler* iKeyEventHandler; |
|
324 |
||
325 |
//Holds the Ref to CMd Handler - Doesnt Own |
|
326 |
MVIMPSTCmdHandler& iCommandHandler; |
|
327 |
||
328 |
//Doesnt Own |
|
329 |
MVIMPSTProcessArray& iArrayProcess; |
|
330 |
||
331 |
//Service Id |
|
332 |
TUint32 iServiceId ; |
|
333 |
||
334 |
//doesnt own - Brand Handler |
|
335 |
CVIMPSTUiBrandData& iBrandHandler; |
|
336 |
||
337 |
//doesnt own - Engine Handler |
|
338 |
MVIMPSTEngine& iEngine; |
|
339 |
||
340 |
// Owns. Listbox to view friends-list data |
|
341 |
CVIMPSTUiDoubleStyleListBox* iListBox; |
|
342 |
||
343 |
// Owns. Search field. |
|
344 |
CAknSearchField* iFindbox; |
|
345 |
||
346 |
// is find pane visible. |
|
347 |
TBool iFindPaneIsVisible; |
|
348 |
||
349 |
//current state |
|
350 |
TBool iCurrentState; |
|
351 |
||
352 |
// Owns: Flag to check whether the last contact was selected |
|
353 |
TBool iLastItemFlag; |
|
354 |
||
355 |
CFbsBitmap* iBitmap; |
|
356 |
||
357 |
TInt iAvatarError; |
|
358 |
||
359 |
// CBA. not owned |
|
360 |
CEikButtonGroupContainer* iCba; |
|
361 |
||
362 |
// Lock status foc softkeys |
|
363 |
TBool iCbaLock; |
|
364 |
||
365 |
// Storage for previous focus |
|
366 |
TVIMPSTEnums::TItem iLastFocusedItemType; |
|
367 |
||
368 |
//flag to check to clear find pane |
|
369 |
TBool iClrFindPaneFlag; |
|
370 |
||
371 |
//indicate command to be executed on enter key Event. |
|
372 |
TInt iCurrentCmdToExe; |
|
373 |
||
374 |
||
375 |
}; |
|
376 |
||
377 |
#endif // __CVIMPSTUIDOUBLELISTBOXTABVIEWCONTROL_H |
|
378 |
||
379 |
// End of file |