|
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 is view class for chat group view |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCACHATVIEW_H |
|
21 #define CCACHATVIEW_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "CCAView.h" |
|
25 #include "MCARecipientObserver.h" |
|
26 #include "mcagroupobserverpc.h" |
|
27 #include "PublicEngineDefinitions.h" |
|
28 #include "MCATabObserver.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CCAChatViewContainer; |
|
32 class CCAMessageExtensionsHandler; |
|
33 class CAsyncCallBack; |
|
34 class CFindItemMenu; |
|
35 class CItemFinder; |
|
36 class CEikButtonGroupContainer; |
|
37 class MCAGroupPC; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * This is class for chat group view |
|
43 * @since 3.2 |
|
44 */ |
|
45 class CCAChatView : public CCAView, |
|
46 public MCARecipientObserver, |
|
47 public MCAGroupObserverPC, |
|
48 public MCATabObserver |
|
49 { |
|
50 |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * C++ default constructor |
|
55 */ |
|
56 CCAChatView(); |
|
57 |
|
58 /** |
|
59 * Symbian OS default constructor. |
|
60 * @param aAvkonViewResourceId Id for resource used |
|
61 * to construct this view |
|
62 * @param aViewId View id |
|
63 * @param aMessageHandler -reference to Message Extension Handler |
|
64 */ |
|
65 void ConstructL( TInt aAvkonViewResourceId, TUid aViewId, |
|
66 CCAMessageExtensionsHandler& aMessageHandler ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~CCAChatView(); |
|
72 |
|
73 protected: // Functions from base classes |
|
74 |
|
75 /** |
|
76 * From MEikMenuObserver, Called by framework before |
|
77 * constructing menupane |
|
78 * @param aResourceId Resource to be constructed |
|
79 * @param aMenuPane Pointer to menupane being constructed |
|
80 */ |
|
81 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
82 |
|
83 /** |
|
84 * From CAknView |
|
85 * @param aCommand Command that was received |
|
86 */ |
|
87 void HandleCommandL( TInt aCommand ); |
|
88 |
|
89 /** |
|
90 * Handles foreground event |
|
91 * @param aForeground ETrue if foreground else EFalse |
|
92 * @see CAknView |
|
93 */ |
|
94 void HandleForegroundEventL( TBool aForeground ); |
|
95 |
|
96 private: // From CAknView |
|
97 |
|
98 /** |
|
99 * From CAknView, Gets called from framework when activating this view |
|
100 * @param aPrevViewId Previous view id |
|
101 * @param aCustomMessageId Custom message's id |
|
102 * @param aCustomMessage Custom message |
|
103 */ |
|
104 void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, |
|
105 const TDesC8& aCustomMessage ); |
|
106 |
|
107 /** |
|
108 * From AknView. Deactivates |
|
109 */ |
|
110 void DoDeactivate(); |
|
111 |
|
112 private: // functions from MCARecipientObserver |
|
113 |
|
114 /** |
|
115 * Shows recipient list in chat and I-box view |
|
116 * @param aResourceId The resource id where to build list |
|
117 * @return result of query 0 if canceled else 1 |
|
118 */ |
|
119 TInt ShowRecipientsListL( TInt aResourceId ); |
|
120 |
|
121 /** |
|
122 * Shows customized menu |
|
123 */ |
|
124 void ShowPopUpMenuL(); |
|
125 |
|
126 private: // From MCAGroupObserverPC |
|
127 |
|
128 |
|
129 /** |
|
130 * @see MCAGroupObserverPC |
|
131 */ |
|
132 |
|
133 void HandleChatEvent( const TDesC& aWvid = KNullDesC, |
|
134 const TDesC& aContactId = KNullDesC ); |
|
135 |
|
136 /** |
|
137 * Actual handler for chat events |
|
138 */ |
|
139 void DoHandleChatEventL( const TDesC& aWvid = KNullDesC, |
|
140 const TDesC& aContactId = KNullDesC ); |
|
141 |
|
142 |
|
143 |
|
144 /** |
|
145 * @see MCAGroupObserverPC |
|
146 */ |
|
147 void HandleMessageError( TInt aError, const TDesC& aNick = KNullDesC ); |
|
148 |
|
149 /** |
|
150 * Leavable version of error handler |
|
151 * @see HandleMessageError |
|
152 */ |
|
153 void DoHandleMessageErrorL( TInt aError, const TDesC& aNick = KNullDesC ); |
|
154 |
|
155 |
|
156 private: // From MCATabObserver |
|
157 |
|
158 /** |
|
159 * @see MCATabObserver |
|
160 */ |
|
161 void SwitchTabL( const TDesC& aWvId, const TInt aTabIndex ); |
|
162 |
|
163 private: // new methods |
|
164 |
|
165 /** |
|
166 * Displays list of joined members |
|
167 */ |
|
168 void DisplayJoinedMembersL(); |
|
169 |
|
170 /** |
|
171 * Updates selected item type |
|
172 */ |
|
173 void UpdateItemTypeL(); |
|
174 |
|
175 /** |
|
176 * Callback function for launching the invite query |
|
177 * Called by CAsyncCallBack |
|
178 * @param aInstance Instance of this class |
|
179 * @return Need for recall |
|
180 */ |
|
181 static TInt LaunchInvite( TAny *aInstance ); |
|
182 |
|
183 /** |
|
184 * The actual implementation |
|
185 * @param aShowQuery If ETrue, ask the user |
|
186 */ |
|
187 void DoLaunchInviteL( TBool aShowQuery ); |
|
188 |
|
189 public: // new methods |
|
190 |
|
191 /** |
|
192 * Whether menu has been poped up |
|
193 */ |
|
194 TBool GetIfMenuPopup(); |
|
195 private: // Data |
|
196 |
|
197 // Pointer to callback |
|
198 CAsyncCallBack* iAsyncCallBack; |
|
199 |
|
200 // Previous view's id |
|
201 TVwsViewId iPrevViewId; |
|
202 |
|
203 // Owns. Container |
|
204 CCAChatViewContainer* iContainer; |
|
205 |
|
206 // Owns. Array of recipients |
|
207 CDesCArray* iRecipients; |
|
208 |
|
209 // Owns. Popup-menu for add to friends and reply |
|
210 CEikMenuBar* iAddAndReplyMenu; |
|
211 |
|
212 // Owns. Popup-menu for find item UI |
|
213 CEikMenuBar* iFindContextMenu; |
|
214 |
|
215 //Array of joined members. Owns |
|
216 CDesCArrayFlat* iJoinedMembers; |
|
217 |
|
218 //Group id. Owns |
|
219 HBufC* iGroupId; |
|
220 |
|
221 //recipient. Owns |
|
222 HBufC* iRecipient; |
|
223 |
|
224 //Sender. Owns |
|
225 HBufC* iSender; |
|
226 |
|
227 //Sender without the "wv:" prefix |
|
228 TPtrC iCleanSender; |
|
229 |
|
230 //Does not own. Extension handler for messages |
|
231 CCAMessageExtensionsHandler* iMessageHandler; |
|
232 |
|
233 // not owned. Hides CBA buttons when needed |
|
234 CEikButtonGroupContainer* iCba; |
|
235 |
|
236 //Doesnt Own, Ptr to Group PC interface |
|
237 MCAGroupPC* iGroupPC; |
|
238 |
|
239 // owns. menu pane for find item functionality |
|
240 CFindItemMenu* iFindMenu; |
|
241 |
|
242 // owns. |
|
243 CItemFinder* iItemFinder; |
|
244 |
|
245 //TabId for this group |
|
246 TInt iTabId; |
|
247 |
|
248 //doesn't own, pointer to grouputils |
|
249 CCAGroupUtils* iGroupUtils; |
|
250 |
|
251 // A indicator for object process |
|
252 TBool iObjectOpenedSaved; |
|
253 |
|
254 CEikMenuPane *iMenuPane; |
|
255 }; |
|
256 |
|
257 #endif //CCACHATVIEW_H |
|
258 |
|
259 // End of File |