|
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: Container for recorded chat view |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CCARECORDEDCHATSCONTAINER_H__ |
|
21 #define __CCARECORDEDCHATSCONTAINER_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include "MCALayoutChangeObserver.h" |
|
25 #include "mcatapeventobserver.h" |
|
26 #include "MCAMsgAddedToRichTxtCtrlObserver.h" |
|
27 #include <coecobs.h> |
|
28 |
|
29 #include <aknview.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CCAChatViewControl; |
|
33 class MCAViewSwitcher; |
|
34 class MCARecordedChatProvider; |
|
35 class MCASettingsPC; |
|
36 class CGulIcon; |
|
37 class MCASkinVariant; |
|
38 class CCAAppUi; |
|
39 class MCAConversationMessage; |
|
40 class MCARecipientObserver; |
|
41 class MCARecordedChatsPC; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * container class for chat view |
|
47 * |
|
48 * @lib chatng.app |
|
49 * @since 3.2 |
|
50 */ |
|
51 class CCARecordedChatsContainer : public CCoeControl, |
|
52 public MCALayoutChangeObserver, |
|
53 public MCATapEventObserver, |
|
54 public MCAMsgAddedToRichTxtCtrlObserver, |
|
55 public MCoeControlObserver |
|
56 { |
|
57 private: // Enumerations |
|
58 |
|
59 /** |
|
60 * Context menubar event source |
|
61 */ |
|
62 enum TContextLaunchEvent |
|
63 { |
|
64 EKeyActivation, |
|
65 ESingleClick, |
|
66 EDoubleClick |
|
67 }; |
|
68 |
|
69 |
|
70 public: // Constructors and destructor |
|
71 |
|
72 /** |
|
73 * Symbian default constructor |
|
74 * @param aRect Frame rectangle for container. |
|
75 * @param aViewSwitcher Handle to view-switcher |
|
76 * @param aRecordedChatArrayProvider: Provides the list of saved conversations |
|
77 * This is the interface from which CCARecordedChatsArray derives. |
|
78 * @param aContextMenu Context sensitive menu. |
|
79 * @param aObjectProvider Context access mechanism. |
|
80 * @param aSettingsPC: reference to the settings process component |
|
81 * @param aAppUi: Pointer to the AppUI instance |
|
82 * @param aRecordedChatsPC: The reference to recorded chats process component |
|
83 */ |
|
84 static CCARecordedChatsContainer* NewL( |
|
85 const TRect& aRect, |
|
86 MCAViewSwitcher& aViewSwitcher, |
|
87 MCARecordedChatProvider& aRecordedChatArrayProvider, |
|
88 MCARecipientObserver& aContextMenu, |
|
89 MObjectProvider& aObjectProvider, |
|
90 MCASettingsPC& aSettingsPC, |
|
91 CCAAppUi* aAppUi, |
|
92 MCARecordedChatsPC& aRecordedChatsPC ); |
|
93 |
|
94 /** |
|
95 * Destructor. |
|
96 */ |
|
97 virtual ~CCARecordedChatsContainer(); |
|
98 |
|
99 |
|
100 |
|
101 public: // New functions |
|
102 |
|
103 /** |
|
104 * This checks if scroll mode is on or off |
|
105 * @since 3.2 |
|
106 * @return ETrue when scrolling is stopped else return EFalse. |
|
107 */ |
|
108 TBool IsStopped() const; |
|
109 |
|
110 /** |
|
111 * Returns buffer containing the currently selected text |
|
112 * (or empty buffer if nothing selected) |
|
113 */ |
|
114 HBufC* SelectedItemL(); |
|
115 |
|
116 /** |
|
117 * @return Type of selected item |
|
118 */ |
|
119 TInt SelectedItemType(); |
|
120 |
|
121 /** |
|
122 * @return Forward to contact-menu visible (ETrue) |
|
123 * @since 3.2 |
|
124 */ |
|
125 TBool FwdContactVisible(); |
|
126 |
|
127 /** |
|
128 * @return Forward to group-menu visible (ETrue) |
|
129 * @since 3.2 |
|
130 */ |
|
131 TBool FwdGroupVisible(); |
|
132 |
|
133 /** |
|
134 * Check if selected item is object |
|
135 * @param aIsOpenable method sets this ETrue if selected item |
|
136 * is openable object else set to EFalse |
|
137 * @return ETrue if selected item is object |
|
138 * @since 3.2 |
|
139 */ |
|
140 TBool IsObjectSelected( TBool& aIsOpenable, TBool& aIsSaved ); |
|
141 |
|
142 /** |
|
143 * @return Selected message or NULL if nothing selected |
|
144 * @since 3.2 |
|
145 */ |
|
146 MCAConversationMessage* SelectedMessage(); |
|
147 |
|
148 /** |
|
149 * This function forwards the message to group |
|
150 * @since 3.2 |
|
151 */ |
|
152 void ForwardToGroupL(); |
|
153 |
|
154 /** |
|
155 * This function forwards the message to contact |
|
156 * @since 3.2 |
|
157 */ |
|
158 void ForwardToContactL(); |
|
159 |
|
160 /** |
|
161 * Sets item highlighting on or off (automatic find) |
|
162 * @param aHihghlight ETrue to set finder on |
|
163 * @since 3.2 |
|
164 */ |
|
165 void SetItemHighlightL( TBool aHighlight ); |
|
166 |
|
167 /** |
|
168 * Free memory so that viewswitch is made possible. |
|
169 * In OOM situation the framework cannot create a new container |
|
170 * nor change the view if the current container hogs all the memory. |
|
171 * This method should however make sure that the current view is still |
|
172 * usable after this call, because viewswitch might not succeed. |
|
173 */ |
|
174 void FreeMemoryForViewSwitch(); |
|
175 |
|
176 private: // Functions from base classes |
|
177 |
|
178 /** |
|
179 * @see MCALayoutChangeObserver |
|
180 */ |
|
181 void LayoutChangedL( TInt aType ); |
|
182 |
|
183 /** |
|
184 * @see CCoeControl |
|
185 */ |
|
186 void SizeChanged(); |
|
187 |
|
188 /** |
|
189 * From CCoeControl, Gets called when drawing is needed (by framework) |
|
190 * @param aRect Rect that needs to be drawed |
|
191 */ |
|
192 void Draw( const TRect& aRect ) const; |
|
193 |
|
194 /** |
|
195 * @see CCoeControl |
|
196 */ |
|
197 TInt CountComponentControls() const; |
|
198 |
|
199 /** |
|
200 * @see CCoeControl |
|
201 */ |
|
202 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
203 |
|
204 /** |
|
205 * @see CCoeControl |
|
206 */ |
|
207 TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, |
|
208 TEventCode aType ); |
|
209 |
|
210 /** |
|
211 * @see CCoeControl |
|
212 */ |
|
213 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
214 |
|
215 /** |
|
216 * @see MCATapEventObserver |
|
217 */ |
|
218 void HandleTapEventL( TTapEvent aEvent, TUint aControlId ); |
|
219 |
|
220 private: //Private functions |
|
221 |
|
222 /** |
|
223 * Sets the default title of this view |
|
224 */ |
|
225 void SetDefaultTitleL(); |
|
226 |
|
227 /** |
|
228 * To load the icons |
|
229 */ |
|
230 void LoadBitmapsL(); |
|
231 |
|
232 /** |
|
233 * Updates CBA. |
|
234 * @since S60 v3.2 |
|
235 */ |
|
236 void UpdateCbaL(); |
|
237 |
|
238 /** |
|
239 * Opens context sensitive menubar |
|
240 * @since S60 v3.2 |
|
241 */ |
|
242 void ShowContextMenuL( TContextLaunchEvent aLaunchEvent ); |
|
243 |
|
244 private: //from MCAMsgAddedToRichTxtCtrlObserver |
|
245 |
|
246 /** |
|
247 * @see MCAMsgAddedToRichTxtCtrlObserver |
|
248 */ |
|
249 void HandleMessageAddedL( const TInt aMessageCount ); |
|
250 |
|
251 private: // From MCoeControlObserver |
|
252 |
|
253 /** |
|
254 * @see MCoeControlObserver |
|
255 */ |
|
256 void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); |
|
257 |
|
258 private: //Private constructor |
|
259 |
|
260 /** |
|
261 * Constructor |
|
262 * @param aChatProvider: Provides the list of saved conversations |
|
263 * This is the interface from which CCARecordedChatsArray derives. |
|
264 * @param aViewSwitcher Handle to view-switcher |
|
265 * @param aContextMenu Context sensitive menu. |
|
266 * @param aSettingsPC: reference to the settings process component |
|
267 * @param aAppUi: Pointer to the AppUI instance |
|
268 * @param aRecordedChatsPC: The reference to recorded chats process component |
|
269 */ |
|
270 CCARecordedChatsContainer( MCARecordedChatProvider& aChatProvider, |
|
271 MCAViewSwitcher& aViewSwitcher, |
|
272 MCARecipientObserver& aContextMenu, |
|
273 MCASettingsPC& aSettingsPC, |
|
274 CCAAppUi* aAppUi, |
|
275 MCARecordedChatsPC& aRecordedChatsPC ); |
|
276 |
|
277 /** |
|
278 * Symbian OS default constructor. |
|
279 * @param aRect Frame rectangle for container. |
|
280 * @param aObjectProvider Context access mechanism. |
|
281 */ |
|
282 void ConstructL( const TRect& aRect, MObjectProvider& aObjectProvider ); |
|
283 |
|
284 |
|
285 private: //data |
|
286 |
|
287 // Doesn't own. Handle to recorded chat provider |
|
288 MCARecordedChatProvider& iRecordedChatArrayProvider; |
|
289 |
|
290 //Doesn't own. Handle to recorded chats process component |
|
291 MCARecordedChatsPC& iRecordedChatsPC; |
|
292 |
|
293 // Owns. Chat view control |
|
294 CCAChatViewControl* iChatView; |
|
295 |
|
296 // Doesn't own. Handle to view-switcher |
|
297 MCAViewSwitcher& iViewSwitcher; |
|
298 |
|
299 // Doesn't own. Context sensitive menu options |
|
300 MCARecipientObserver& iRecipientObserver; |
|
301 |
|
302 //Owns. "From me" icon |
|
303 CGulIcon* iFromMe; |
|
304 |
|
305 //Owns. "To me" icon |
|
306 CGulIcon* iToMe; |
|
307 |
|
308 //Owns. "Unsupported" icon |
|
309 CGulIcon* iUnsupported; |
|
310 |
|
311 //Owns. "Corrupted" icon |
|
312 CGulIcon* iCorrupted; |
|
313 |
|
314 //Doesn't own. Skin variant interface. |
|
315 MCASkinVariant* iSkinVar; |
|
316 |
|
317 //Doesn't own. AppUI. |
|
318 CCAAppUi* iAppUI; |
|
319 |
|
320 /* See IMVariant.hrh. |
|
321 * Flag depends on EIMFeatSendkeyInMsgList. |
|
322 */ |
|
323 TBool iSendkeyInMsgList; |
|
324 |
|
325 /* |
|
326 ** Does not own |
|
327 * reference to MCASettingsPC |
|
328 */ |
|
329 MCASettingsPC& iSettingsPC; |
|
330 }; |
|
331 |
|
332 #endif // __CCARECORDEDCHATSCONTAINER_H__ |
|
333 |
|
334 // End of File |