1 /* |
|
2 * Copyright (c) 2007-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: application main view |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef _CIMCVAPPVIEW_H |
|
21 #define _CIMCVAPPVIEW_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "cimcvappviewcontainer.h" |
|
25 #include <coecntrl.h> |
|
26 #include <aknview.h> |
|
27 #include "mimcvenginemessagehandlerobserver.h" |
|
28 #include "mimcvrecipientobserver.h" |
|
29 #include "mimcvtabobserver.h" |
|
30 #include "mimcvnewmsgfadecontrolobserver.h" |
|
31 #include "mimcvenginechatlistobserver.h" |
|
32 #include <akntoolbarobserver.h> |
|
33 //For KMaxPackedContactLinkLength |
|
34 #include "imcvuiparams.h" |
|
35 #include "mimcvngineservicechangeobserver.h" |
|
36 #include <AiwCommon.h> |
|
37 // FORWARD DECLARATIONS |
|
38 class CIMCVAppUi; |
|
39 class MIMCVEngineChatInterface; |
|
40 class CFindItemMenu; |
|
41 class CItemFinder; |
|
42 class CIMCVAppUi; |
|
43 class CIMCVEngine; |
|
44 class CIMCVAppStatusPaneHandler; |
|
45 class MCCAConnection; |
|
46 class MCCAParameter; |
|
47 class CIMCVMenuExtensionManager; |
|
48 class MIMCVEngineFactory; |
|
49 class CAiwServiceHandler; |
|
50 |
|
51 |
|
52 // CLASS DECLARATION |
|
53 |
|
54 /** |
|
55 * This is view class for conversation view |
|
56 */ |
|
57 |
|
58 class CIMCVAppView : public CAknView, |
|
59 public MIMCVRecipientObserver, |
|
60 public MIMCVTabObserver, |
|
61 public MIMCVNewMsgFadeControlObserver, |
|
62 public MAknToolbarObserver, |
|
63 public MIMCVEngineServiceChangeObserver |
|
64 |
|
65 { |
|
66 |
|
67 public: // Constructors and destructor |
|
68 |
|
69 /** |
|
70 * C++ default constructor. |
|
71 */ |
|
72 CIMCVAppView(); |
|
73 |
|
74 /** |
|
75 * Symbian 2nd phase constructor. |
|
76 * @param aAvkonViewResourceId Resource id for view |
|
77 * @param aViewId Id of the view |
|
78 */ |
|
79 void ConstructL( TInt aAvkonViewResourceId, TUid aViewId, |
|
80 CIMCVAppMessageExtensionsHandler& aMessageHandler); |
|
81 |
|
82 /** |
|
83 * Destructor. |
|
84 */ |
|
85 virtual ~CIMCVAppView(); |
|
86 |
|
87 |
|
88 public : // MIMCVEngineServiceChangeObserver |
|
89 |
|
90 /* |
|
91 * new service has been installed |
|
92 */ |
|
93 void HandleNewServiceL( TInt aServiceId ) ; |
|
94 /* |
|
95 * service has been deleted |
|
96 */ |
|
97 void HandleServiceDeletedL( TInt aServiceId ) ; |
|
98 /** |
|
99 * handle presence change notification |
|
100 * call back from imcvuiengine |
|
101 */ |
|
102 void HandlePresenceChangedL(TInt aServiceId, const TDesC& aBuddyId ) ; |
|
103 |
|
104 /** |
|
105 * Handle message send operation completion. |
|
106 * @param aResult result to handle. |
|
107 */ |
|
108 void HandleOperationCompletdL(TInt aServiceId , MIMCVEngineMessage::TMessagerType aType , TInt aResult); |
|
109 |
|
110 /** |
|
111 * @see HandleConnectionTerminatedL |
|
112 * to handle the connection lost |
|
113 * @param aReason, reason report |
|
114 */ |
|
115 void HandleConnectionEventL(TInt aServiceId, TIMCVConnectionState aState, TInt aReason ) ; |
|
116 |
|
117 /* |
|
118 * See MIMCVEngineChatListObserver |
|
119 */ |
|
120 void HandleChatListEvent(TInt aServiceId, TChatListEventType aEvent, |
|
121 MIMCVEngineMessageReadInterface* aContainerInfo ) ; |
|
122 |
|
123 |
|
124 public: // New methods |
|
125 |
|
126 /** |
|
127 * Handles changes in CBA states |
|
128 * @since 5.0 |
|
129 * @param aResourceId Resource that changes |
|
130 */ |
|
131 void HandleCbaChangeL( TInt aResourceId ); |
|
132 |
|
133 /** |
|
134 * SetStatusPaneIconsL set the icons based on presence status |
|
135 * @since 5.0 |
|
136 */ |
|
137 void SetStatusPaneIconsL(); |
|
138 |
|
139 /** |
|
140 * From MIMCVRecipientObserver |
|
141 * Shows customized menu |
|
142 */ |
|
143 void ShowPopUpMenuL( ); |
|
144 |
|
145 /** |
|
146 * Function to launch help |
|
147 */ |
|
148 void LaunchHelpL( const TDesC& aContext); |
|
149 |
|
150 void ShowMeL( const TDesC8& aParamData ) ; |
|
151 |
|
152 void UpdateToolbarButtonsStateL(); |
|
153 |
|
154 /** |
|
155 * Launches the contact details view |
|
156 * |
|
157 */ |
|
158 void LaunchCcaL(); |
|
159 |
|
160 /* |
|
161 * return active engine reference |
|
162 */ |
|
163 CIMCVEngine& ActiveEngine() const ; |
|
164 |
|
165 private: // Functions from base classes |
|
166 |
|
167 /** |
|
168 * From MEikMenuObserver, Called by framework before |
|
169 * constructing menupane |
|
170 * @param aResourceId Resource to be constructed |
|
171 * @param aMenuPane Pointer to menupane being constructed |
|
172 * @see MEikMenuObserver |
|
173 */ |
|
174 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
175 |
|
176 /** |
|
177 * Resolve currently selected item type and set it to CItemFinder |
|
178 */ |
|
179 void UpdateItemTypeL(); |
|
180 |
|
181 private: |
|
182 |
|
183 /** |
|
184 * From CAknView, Gets called from framework when activating this view |
|
185 * @param aPrevViewId Previous view id |
|
186 * @param aCustomMessageId Custom message's id |
|
187 * @param aCustomMessage Custom message |
|
188 * @see CAknView |
|
189 */ |
|
190 void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, |
|
191 const TDesC8& aCustomMessage); |
|
192 |
|
193 /** |
|
194 * From AknView, deactivates view |
|
195 * @see CAknView |
|
196 */ |
|
197 void DoDeactivate(); |
|
198 |
|
199 |
|
200 |
|
201 /** |
|
202 * From CAknView |
|
203 * @param aCommand Command that was received |
|
204 * @see CAknView |
|
205 */ |
|
206 void HandleCommandL(TInt aCommand); |
|
207 |
|
208 /** |
|
209 * Handles foreground event |
|
210 * @param aForeground ETrue if foreground else EFalse |
|
211 * @see CAknView |
|
212 */ |
|
213 void HandleForegroundEventL( TBool aForeground ); |
|
214 |
|
215 /** |
|
216 * Show query dialog |
|
217 * @param aDialogResourceId resource id |
|
218 * @param aPrompt text to be shown |
|
219 */ |
|
220 TInt DisplayQueryDialogL( TInt aDialogResourceId, |
|
221 const TDesC& aPrompt ); |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 private: |
|
228 /** Helper Function |
|
229 * This function is to be called when switching between tabs |
|
230 * @param aChatId - Switch to this chat item |
|
231 * @param aTabIndex - Index of the tab |
|
232 */ |
|
233 |
|
234 void SwitchTabL(TInt aActiveServiceId , const TDesC& aChatId, const TInt aTabIndex); |
|
235 |
|
236 |
|
237 |
|
238 private: |
|
239 |
|
240 /** |
|
241 * From MIMCVNewMsgFadeControlObserver |
|
242 * @see MIMCVNewMsgFadeControlObserver |
|
243 */ |
|
244 void NotifyWhenCompleted() ; |
|
245 |
|
246 /** |
|
247 * From MIMCVNewMsgFadeControlObserver |
|
248 * @see MIMCVNewMsgFadeControlObserver |
|
249 */ |
|
250 void NotifyWhenStarted(); |
|
251 |
|
252 public: |
|
253 /** |
|
254 * This function is to be called when left/right Navigation key is pressed |
|
255 * @param aKeyEvent |
|
256 * @param aType |
|
257 */ |
|
258 TKeyResponse OfferTabEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
259 public: // MAknToolbarObserver |
|
260 /** |
|
261 * Called when toolbar events occur |
|
262 * |
|
263 * @since 5.0 |
|
264 * @return void |
|
265 */ |
|
266 void OfferToolbarEventL( TInt aCommand ) { HandleCommandL(aCommand); } |
|
267 |
|
268 private: |
|
269 /** |
|
270 * id from base clas. |
|
271 */ |
|
272 |
|
273 TUid Id() const; |
|
274 |
|
275 /** |
|
276 * constructs necessary icons for this decorator |
|
277 * @return Icon. |
|
278 **/ |
|
279 CGulIcon* LoadBitmapL( ); |
|
280 |
|
281 |
|
282 /** |
|
283 * refreshes the view. |
|
284 */ |
|
285 void ViewRefreshL(); |
|
286 |
|
287 /* |
|
288 * switch the valid service references |
|
289 */ |
|
290 void SwitchToValidServiceL( TInt aServiceId ); |
|
291 |
|
292 /* |
|
293 * Deltete the CIMCVAppRichTextContainerCache when xsp id deleted from detail view.. |
|
294 */ |
|
295 void DeleteContainerCache(const TDesC& aPrimaryKey, TInt aServiceId ); |
|
296 |
|
297 private: // Data |
|
298 |
|
299 // View's UID |
|
300 TUid iViewId; |
|
301 |
|
302 // Owns. Container |
|
303 CIMCVAppViewContainer* iContainer; |
|
304 |
|
305 //Owns. Contact id |
|
306 HBufC* iRecipientUserId; |
|
307 |
|
308 //Doesn't own. Message handler |
|
309 CIMCVAppMessageExtensionsHandler* iExtensionHandler; |
|
310 |
|
311 |
|
312 // not owned, from CCoeEnv |
|
313 CIMCVAppUi* iAppUi; |
|
314 |
|
315 |
|
316 //stores the default MBM path |
|
317 TFileName iDefaultMbmPath; |
|
318 |
|
319 // Owns. Popup-menu for find item UI |
|
320 CEikMenuBar* iFindContextMenu; |
|
321 |
|
322 // owns. menu pane for find item functionality |
|
323 CFindItemMenu* iFindMenu; |
|
324 |
|
325 // owns. |
|
326 CItemFinder* iItemFinder; |
|
327 |
|
328 //Service Id |
|
329 TInt iServiceId; |
|
330 |
|
331 //Doesnt Own |
|
332 CIMCVAppStatusPaneHandler* iStatusPane; |
|
333 |
|
334 |
|
335 MCCAConnection* iConnection; |
|
336 |
|
337 MCCAParameter* iParameter; |
|
338 |
|
339 TBool iViewDeactivated; |
|
340 |
|
341 //Owns Cache to store CIMCVAppRichTextContainer objects |
|
342 CIMCVAppRichTextContainerCache* iRTContainerCache; |
|
343 |
|
344 //Owns. "From me" icon |
|
345 CGulIcon* iFromMe; |
|
346 |
|
347 //Owns. "To me" icon |
|
348 CGulIcon* iToMe; |
|
349 |
|
350 //Owns Menu Extention manager |
|
351 CIMCVMenuExtensionManager* iMenuExtManager; |
|
352 |
|
353 // not owns : reference to imcvuiengine component |
|
354 MIMCVEngineFactory* iEngineFactory ; |
|
355 |
|
356 // not owns : active change engine pointer |
|
357 CIMCVEngine* iActiveEngine; |
|
358 |
|
359 // not owned , chat interface |
|
360 MIMCVEngineChatInterface* iActiveChatInterface; |
|
361 //owns. object of aiwservicehandler. |
|
362 CAiwServiceHandler *iAiwServiceHandler; |
|
363 |
|
364 //Keep track if Detail view is opened. |
|
365 TBool iDetailViewOpen; |
|
366 |
|
367 //Keep track, if conv. view need to be closed when xsp id is deleted |
|
368 //when doing back operation conv. view need to be closed if xsp id deleted from detail view. |
|
369 TBool iConvViewDel ; |
|
370 |
|
371 |
|
372 }; |
|
373 |
|
374 #endif // _CIMCVAPPVIEW_H |
|