|
1 /* |
|
2 * Copyright (c) 2006 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: View class for conversation view |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCACONVERSATIONSVIEW_H |
|
21 #define CCACONVERSATIONSVIEW_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "CCAView.h" |
|
25 #include "MCARecipientObserver.h" |
|
26 #include "PublicEngineDefinitions.h" |
|
27 #include "MCAConversationObserverPC.h" |
|
28 #include "CCAConversationsContainer.h" // MCATitleUpdater |
|
29 #include "mcablockchecker.h" |
|
30 #include "MCATabObserver.h" |
|
31 #include "chatdefinitions.h" |
|
32 #include <akntabgrp.h> |
|
33 #include <AknInfoPopupNoteController.h> // for CAKnInfoPopupNote |
|
34 #include "TEnumsPC.h" |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class MCAIndicatorTerminator; |
|
38 class CFindItemMenu; |
|
39 class CItemFinder; |
|
40 class CEikButtonGroupContainer; |
|
41 class CCAAppUi; |
|
42 class MCAConversationPC; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 |
|
46 /** |
|
47 * This is view class for conversation view |
|
48 * |
|
49 * @lib chatng.exe |
|
50 * @since 3.2 |
|
51 */ |
|
52 class CCAConversationsView : |
|
53 public CCAView, |
|
54 public MCARecipientObserver, |
|
55 public MCAConversationObserverPC, |
|
56 public MCATitleUpdater, // For updating title |
|
57 public MCAEditorContentStorage, // For storing editor content |
|
58 public MCABlockChecker, |
|
59 public MCATabObserver |
|
60 { |
|
61 |
|
62 public: // Constructors and destructor |
|
63 |
|
64 /** |
|
65 * C++ default constructor. |
|
66 */ |
|
67 CCAConversationsView(); |
|
68 |
|
69 /** |
|
70 * Symbian 2nd phase constructor. |
|
71 * @param aAvkonViewResourceId Resource id for view |
|
72 * @param aViewId Id of the view |
|
73 */ |
|
74 void ConstructL( TInt aAvkonViewResourceId, TUid aViewId, |
|
75 CCAMessageExtensionsHandler& aMessageHandler ); |
|
76 |
|
77 /** |
|
78 * Destructor. |
|
79 */ |
|
80 virtual ~CCAConversationsView(); |
|
81 |
|
82 public: // New methods |
|
83 |
|
84 /** |
|
85 * Handles changes in CBA states |
|
86 * @since 3.2 |
|
87 * @param aResourceId Resource that changes |
|
88 */ |
|
89 void HandleCbaChangeL( TInt aResourceId ); |
|
90 |
|
91 /** |
|
92 * Sets the index of last unread message |
|
93 * @since 3.2 |
|
94 * @param aLastUnreadIndex |
|
95 */ |
|
96 void SetLastUnreadIndex( const TInt aLastUnreadIndex = -1 ); |
|
97 |
|
98 |
|
99 private: //New methods |
|
100 |
|
101 /** |
|
102 * Closes conversation |
|
103 */ |
|
104 void CloseConversationL(); |
|
105 |
|
106 /** |
|
107 * This function forwards the message to contact |
|
108 * @since 3.2 |
|
109 */ |
|
110 void ForwardToContactL(); |
|
111 |
|
112 /** |
|
113 * This function forwards the message to group |
|
114 * @since 3.2 |
|
115 */ |
|
116 void ForwardToGroupL(); |
|
117 |
|
118 |
|
119 |
|
120 private: // Functions from base classes |
|
121 |
|
122 /** |
|
123 * From MEikMenuObserver, Called by framework before |
|
124 * constructing menupane |
|
125 * @param aResourceId Resource to be constructed |
|
126 * @param aMenuPane Pointer to menupane being constructed |
|
127 * @see MEikMenuObserver |
|
128 */ |
|
129 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
130 |
|
131 |
|
132 private: // From MCAConversationObserverPC |
|
133 |
|
134 /** |
|
135 * @see MCAConversationObserverPC |
|
136 */ |
|
137 |
|
138 void HandleChatEvent( const TDesC& aWvid, |
|
139 const TDesC& aContactId ) ; |
|
140 |
|
141 /** |
|
142 * @see MCAConversationObserverPC |
|
143 */ |
|
144 void HandleContactChange( const TDesC& aContactId ); |
|
145 |
|
146 |
|
147 /** |
|
148 * @see MCAConversationObserverPC |
|
149 */ |
|
150 void HandleMessageError( TInt aError, |
|
151 const TDesC& aInfo, |
|
152 TEnumsPC::TContentType aMsgContentType ) ; |
|
153 |
|
154 |
|
155 private: |
|
156 |
|
157 void DoHandleChatEventL( const TDesC& aWvid, |
|
158 const TDesC& aContactId ); |
|
159 |
|
160 void DoHandleMessageErrorL( TInt aError, |
|
161 const TDesC& aInfo, |
|
162 TEnumsPC::TContentType aMsgContentType ); |
|
163 |
|
164 |
|
165 private: |
|
166 |
|
167 /** |
|
168 * From CAknView, Gets called from framework when activating this view |
|
169 * @param aPrevViewId Previous view id |
|
170 * @param aCustomMessageId Custom message's id |
|
171 * @param aCustomMessage Custom message |
|
172 * @see CAknView |
|
173 */ |
|
174 void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, |
|
175 const TDesC8& aCustomMessage ); |
|
176 |
|
177 /** |
|
178 * From AknView, deactivates view |
|
179 * @see CAknView |
|
180 */ |
|
181 void DoDeactivate(); |
|
182 |
|
183 /** |
|
184 * From MCARecipientObserver |
|
185 * Shows recipient list |
|
186 * @param aResourceId Resource id for pop up list |
|
187 * @return Positive value if Oked |
|
188 * @see CAknView |
|
189 */ |
|
190 TInt ShowRecipientsListL( TInt aResourceId ); |
|
191 |
|
192 /** |
|
193 * From MCARecipientObserver |
|
194 * Shows customized menu |
|
195 * @see CAknView |
|
196 */ |
|
197 void ShowPopUpMenuL( ); |
|
198 |
|
199 /** |
|
200 * From CAknView |
|
201 * @param aCommand Command that was received |
|
202 * @see CAknView |
|
203 */ |
|
204 void HandleCommandL( TInt aCommand ); |
|
205 |
|
206 /** |
|
207 * Handles foreground event |
|
208 * @param aForeground ETrue if foreground else EFalse |
|
209 * @see CAknView |
|
210 */ |
|
211 void HandleForegroundEventL( TBool aForeground ); |
|
212 |
|
213 /** |
|
214 * Shows Templates menu |
|
215 */ |
|
216 void ShowTemplatesL(); |
|
217 |
|
218 public: |
|
219 /** |
|
220 * @see MCATabObserver |
|
221 */ |
|
222 void SwitchTabL( const TDesC& aWvId, const TInt aTabIndex ) ; |
|
223 |
|
224 private: |
|
225 |
|
226 /** |
|
227 * Resolve currently selected item type and set it to CItemFinder |
|
228 */ |
|
229 void UpdateItemTypeL(); |
|
230 |
|
231 private: // From MCATitleUpdater |
|
232 |
|
233 /** |
|
234 * Update title |
|
235 */ |
|
236 void UpdateTitleL(); |
|
237 |
|
238 private: // From MCAEditorContentStorage |
|
239 |
|
240 /** |
|
241 * @see MCAEditorContentStorage |
|
242 */ |
|
243 void StoreContent( const HBufC* aContent ); |
|
244 |
|
245 private: // From MCABlockChecker |
|
246 |
|
247 /** |
|
248 * @see MCABlockChecker |
|
249 */ |
|
250 void CheckBlockedL(); |
|
251 |
|
252 |
|
253 private: // Data |
|
254 |
|
255 // Previous view's id |
|
256 TVwsViewId iPrevViewId; |
|
257 |
|
258 // Owns. Container |
|
259 CCAConversationsContainer* iContainer; |
|
260 |
|
261 // Owns. Popup-menu for add to friends and reply |
|
262 CEikMenuBar* iAddAndReplyMenu; |
|
263 |
|
264 // Owns. Popup-menu for find item UI |
|
265 CEikMenuBar* iFindContextMenu; |
|
266 |
|
267 //Owns. Contact id |
|
268 HBufC* iContactId; |
|
269 //Owns. ListId |
|
270 HBufC* iListId; |
|
271 //Owns. Title |
|
272 HBufC* iTitle; |
|
273 |
|
274 //Owns. Sender |
|
275 HBufC* iSender; |
|
276 |
|
277 // displayid'd sender |
|
278 TPtrC iCleanSender; |
|
279 |
|
280 TInt iLastUnreadIndex; |
|
281 TBool iForeground; |
|
282 |
|
283 //Doesn't own. Message handler |
|
284 CCAMessageExtensionsHandler* iMessageHandler; |
|
285 |
|
286 // owns. menu pane for find item functionality |
|
287 CFindItemMenu* iFindMenu; |
|
288 |
|
289 // owns. |
|
290 CItemFinder* iItemFinder; |
|
291 |
|
292 // not owned, used to hide the CBA |
|
293 CEikButtonGroupContainer* iCba; |
|
294 |
|
295 // not owned, from CCoeEnv |
|
296 CCAAppUi* iAppUI; |
|
297 |
|
298 // Owns. |
|
299 const HBufC* iEditorContent; |
|
300 |
|
301 // doesnt own. Ptr to the process component for conversations |
|
302 MCAConversationPC* iConversationPC; |
|
303 |
|
304 //current tab id |
|
305 TInt iTabId; |
|
306 //doesnt own |
|
307 CCAStatusPaneHandler* iTitlePane; |
|
308 |
|
309 // A indicator for object process |
|
310 TBool iObjectOpenedSaved; |
|
311 }; |
|
312 |
|
313 #endif // CCACONVERSATIONSVIEW_H |