|
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: This class handles status, title and contextpane operations |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCASTATUSPANEHANDLER_H |
|
21 #define CCASTATUSPANEHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <akntabgrp.h> |
|
25 #include <aknnavide.h> |
|
26 #include <akntitle.h> |
|
27 #include <akncontext.h> |
|
28 #include <aknindicatorcontainer.h> |
|
29 #include <akneditstateindicator.h> |
|
30 |
|
31 #include <akntabobserver.h> |
|
32 |
|
33 #include "MCAMainViewObserverPC.h" |
|
34 #include "MCATabObserver.h" |
|
35 |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CCAAppUi; |
|
39 class MCAOpenChatsPC; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * This class handles status, title and contextpane operations |
|
45 * |
|
46 * @chatng.exe |
|
47 * @since 3.2 |
|
48 */ |
|
49 class CCAStatusPaneHandler : public CBase, public MAknTabObserver, |
|
50 public MCAMainViewObserverPC |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * C++ default constructor. |
|
56 */ |
|
57 CCAStatusPaneHandler(); |
|
58 |
|
59 /** |
|
60 * Two-phased constructor. |
|
61 */ |
|
62 static CCAStatusPaneHandler* NewL(); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~CCAStatusPaneHandler(); |
|
68 |
|
69 public: // New functions |
|
70 |
|
71 /** |
|
72 * Hides navi-pane decorators |
|
73 * @since 1.2 |
|
74 * @param aPicture Bitmap file |
|
75 * @param aMask Bitmap mask file |
|
76 */ |
|
77 void SetPicture( const CFbsBitmap* aPicture, const CFbsBitmap* aMask ); |
|
78 |
|
79 /** |
|
80 * Shows navi-pane's tabgroup-decorator according to aResourceId |
|
81 * and activates a tab which has TabId=aViewId. |
|
82 * @since 1.2 |
|
83 * @param aViewId ViewId of the view that is visible |
|
84 */ |
|
85 void ShowTabGroupL( const TUid /*aViewId*/ ); |
|
86 |
|
87 /** |
|
88 * Shows navi-pane's tabgroup-decorator according to aResourceId |
|
89 * and activates a tab which has aType. |
|
90 * @param aType - Type of tab Invitation/conversation |
|
91 * @param aWvId - user id |
|
92 * @param aInvitationTime - Received Time of the Invitation ( Only applicable to |
|
93 * invitations, for others you can pass any value. suggested is TTime() ) |
|
94 * @since 3.2 |
|
95 */ |
|
96 TInt ShowTabGroupL( const TEnumsPC::TItem aType, const TDesC& aWvId, |
|
97 const TBool noCreate = EFalse ); |
|
98 |
|
99 /** |
|
100 * pops the navi-pane's tabgroup-decorator |
|
101 * unregisters from the registered observers |
|
102 * Synchronises the process component list |
|
103 * @since 3.2 |
|
104 */ |
|
105 void SynchroniseAndRemoveTabGroup( ); |
|
106 |
|
107 /** |
|
108 * Hides navi-pane decorators. |
|
109 * @param aAllowDuplicates If this is true, duplicate default navi pane |
|
110 * contents are allowed. Duplicates need to be removed with PopNaviPane |
|
111 * when not needed anymore. |
|
112 * @since 1.2 |
|
113 */ |
|
114 void ClearNaviPaneL( TBool aAllowDuplicates = EFalse ); |
|
115 |
|
116 /** |
|
117 * Sets title-pane text. |
|
118 * @since 1.2 |
|
119 * @param aTitle Title text |
|
120 */ |
|
121 void SetTitleL( const TDesC& aTitle ); |
|
122 |
|
123 /** |
|
124 * Sets title-pane text. Uses eikon env to load string. |
|
125 * @since 2.1 |
|
126 * @param aEikonEnv Eikon environment to allocate resource |
|
127 * @param aResourceId Resource id |
|
128 */ |
|
129 void SetTitleL( CEikonEnv* aEikonEnv, TInt aResourceId ); |
|
130 |
|
131 /* |
|
132 * Sets title-pane text. Uses StringLoader to load string. |
|
133 * @since 2.1 |
|
134 * @param aResourceId Resource id |
|
135 * @param aSearchString Search string |
|
136 */ |
|
137 void SetTitleL( TInt aResourceId, const TDesC& aSearchString ); |
|
138 |
|
139 /** |
|
140 * Sets navi-pane label |
|
141 * @since 1.2 |
|
142 * @param aTitle Navi-label text |
|
143 */ |
|
144 void SetNaviLabelL( const TDesC& aText ); |
|
145 |
|
146 /** |
|
147 * Returns pointer to currently active decorator's tabgroup. |
|
148 * @since 1.2 |
|
149 * @return pointer to tabgroup |
|
150 */ |
|
151 CAknTabGroup* TabGroup() const; |
|
152 |
|
153 /** |
|
154 * Fetches active tabīs id (ViewId) |
|
155 * @since 1.2 |
|
156 * @return UID of an active tab view |
|
157 */ |
|
158 TUid ActiveTabViewId(); |
|
159 |
|
160 /** |
|
161 * Sets active tab by index. |
|
162 * @since 1.2 |
|
163 * @param aIndex Index of a tab to be activated |
|
164 */ |
|
165 void ActivateTab( const TInt aIndex ); |
|
166 |
|
167 /** |
|
168 * This method returns pointer to indicator container |
|
169 * @since 1.2 |
|
170 * @return Handle to indicator |
|
171 */ |
|
172 CAknIndicatorContainer* Indicator() const; |
|
173 |
|
174 /** |
|
175 * Refresh title pane text, needed in skin change events. |
|
176 * @since 1.2 |
|
177 */ |
|
178 void RefreshTitlePaneTextL(); |
|
179 |
|
180 /* |
|
181 * Gets title-pane text. |
|
182 * Ownership is not transfered. |
|
183 * @since 3.0 |
|
184 */ |
|
185 const TDesC* Title(); |
|
186 |
|
187 /** |
|
188 * Prohibit tab group drawing for full-screen |
|
189 * dialogs. Changes take place during next redraw. |
|
190 * Call from dialog's PreLayoutDynInit. Remember to reset |
|
191 * by calling RestoreNaviPane in the destructor! |
|
192 * @param aProhibit ETrue to prohibit, EFalse to not. |
|
193 * @since 3.0 |
|
194 */ |
|
195 void ProhibitTabGroup( TBool aProhibit = ETrue ); |
|
196 |
|
197 /** |
|
198 * Restore navi pane decorators to the previous state |
|
199 * before ClearNaviPaneL call. |
|
200 * Call in dialog destructor. |
|
201 * @since 3.0 |
|
202 */ |
|
203 void RestoreNaviPane(); |
|
204 |
|
205 /** |
|
206 * Pops the topmost decorator out of the decorator stack. |
|
207 * @since 3.0 |
|
208 */ |
|
209 void PopNaviPane(); |
|
210 |
|
211 |
|
212 |
|
213 void SetActiveTabByIndex( const TInt aIndex ); |
|
214 /** |
|
215 * Delete remainings tab other than current |
|
216 * @param aType type of tab |
|
217 * @param aWvId user id |
|
218 *@param aInvitationTime time of message |
|
219 * @since 3.0 |
|
220 */ |
|
221 TInt ResetAndShowCurrentTabL( const TEnumsPC::TItem aType, |
|
222 const TDesC& aWvId ); |
|
223 private: |
|
224 /** |
|
225 * @see MAknTabObserver |
|
226 */ |
|
227 void TabChangedL( TInt aIndex ); |
|
228 |
|
229 |
|
230 private: |
|
231 |
|
232 /** |
|
233 * @see MCAMainViewObserverPC |
|
234 */ |
|
235 void HandleDelete( const TDesC& aContactId , TEnumsPC::TItem aType ) ; |
|
236 |
|
237 /** |
|
238 * @see MCAMainViewObserverPC |
|
239 */ |
|
240 void HandleAddition( TEnumsPC::TItem aType, TInt aIndex ); |
|
241 |
|
242 /** |
|
243 * @see MCAMainViewObserverPC |
|
244 */ |
|
245 void HandleChange( TEnumsPC::TItem aType, TInt aIndex, TEnumsPC::TChange aChangeType ); |
|
246 |
|
247 /** |
|
248 * @see MCAMainViewObserverPC |
|
249 */ |
|
250 void HandleWatcherEvent( const TDesC& aString , TEnumsPC::TOnlineStatus aOnlineStatus ); |
|
251 |
|
252 /** |
|
253 * @see MCAMainViewObserverPC |
|
254 */ |
|
255 void HandleInvitationEventL( TEnumsPC::TInviteType aInviteType, |
|
256 const TDesC& aUserId, |
|
257 const TDesC& aMessage ); |
|
258 |
|
259 /** |
|
260 * @see MCAMainViewObserverPC |
|
261 */ |
|
262 void HandleInvitationResponse( TBool aAcceptance, |
|
263 const TDesC& aUserId, |
|
264 const TDesC& aGroupName, |
|
265 const TDesC& aResponse ); |
|
266 |
|
267 /** |
|
268 * @see MCAMainViewObserverPC |
|
269 */ |
|
270 void HandleSettingsChangeL( TInt aChangedSettingEnum ); |
|
271 |
|
272 public: |
|
273 |
|
274 /** |
|
275 * API used to regiter for MCATabObserver Events |
|
276 */ |
|
277 void AddObserver( MCATabObserver* aObserver ) ; |
|
278 |
|
279 /** |
|
280 * API used to unregiter from MCATabObserver events |
|
281 */ |
|
282 void RemoveObserver( MCATabObserver* aObserver ); |
|
283 |
|
284 |
|
285 const TPtrC GetTabItemIdentification( const TInt aIndex ); |
|
286 private: |
|
287 |
|
288 |
|
289 /** |
|
290 * API to show the tabs |
|
291 */ |
|
292 void ShowTabL(); |
|
293 |
|
294 /** |
|
295 * API to hide the tabs |
|
296 */ |
|
297 void HideTab(); |
|
298 |
|
299 private: |
|
300 |
|
301 /** |
|
302 * Loads/updates bitmaps |
|
303 * @since 1.2 |
|
304 */ |
|
305 void CreateTabsL( const TBool noCreate ); |
|
306 |
|
307 /** |
|
308 * By default Symbian OS constructor is private. |
|
309 */ |
|
310 void ConstructL(); |
|
311 |
|
312 |
|
313 |
|
314 private: // Data |
|
315 |
|
316 // typedef to ease up the usage of decorator-array |
|
317 typedef CArrayPtrFlat<CAknNavigationDecorator> CCANaviPaneStack; |
|
318 |
|
319 // Doesn't own. Handle to navi-pane |
|
320 CAknNavigationControlContainer* iNaviPane; |
|
321 |
|
322 // Owns. New decorated tab-group |
|
323 CAknNavigationDecorator* iNewDecoratedTabGroup; |
|
324 |
|
325 // Owns. Text for navi-pane |
|
326 CAknNavigationDecorator* iNaviPaneText; |
|
327 |
|
328 // Doesn't own. Handle to title-pane |
|
329 CAknTitlePane* iTitlePane; |
|
330 |
|
331 // Flag to trace decorator-status |
|
332 TBool iNaviTabsActivated; |
|
333 |
|
334 // Doesn't own. Handle to context-pane |
|
335 CAknContextPane* iContextPane; |
|
336 |
|
337 // Doesn't own. Handle to appui |
|
338 CCAAppUi* iAppUi; |
|
339 |
|
340 //Owns the OpenChats PC Component |
|
341 MCAOpenChatsPC* iOpenChatsPC; |
|
342 |
|
343 // ETrue if tab group drawing is prohibited |
|
344 TBool iProhibitTabGroup; |
|
345 |
|
346 // Currently active view id |
|
347 TUid iActiveViewId; |
|
348 |
|
349 |
|
350 //Doesn't own |
|
351 RPointerArray< MCATabObserver > iObserverList; |
|
352 |
|
353 //previous tabID |
|
354 TInt iPrevTabId; |
|
355 |
|
356 //Current TabID |
|
357 TInt iCurrentTabId; |
|
358 |
|
359 //owns the new message icon |
|
360 HBufC* iNewMsgIcon; |
|
361 |
|
362 //owns the tabtext to be displayed for invitations |
|
363 HBufC* iInvitationTabText; |
|
364 |
|
365 TInt iOpenChatArrayCount; //record open chat array count |
|
366 |
|
367 }; |
|
368 |
|
369 #endif // CCASTATUSPANEHANDLER_H |
|
370 |
|
371 // End of File |