|
1 /* |
|
2 * Copyright (c) 2004 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: IM client plug-in. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CCNUICLIENTPLUGINIM_H |
|
19 #define __CCNUICLIENTPLUGINIM_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Base.h> |
|
23 #include <f32file.h> |
|
24 #include "CCnUiClientPluginBase.h" |
|
25 #include "MIMPSSharedData.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CPEngNWSessionSlotID2; |
|
29 class CPEngAttributeListStore2; |
|
30 class MPEngAttributeList2; |
|
31 class MPEngPresenceAttrModel2; |
|
32 class RResourceFile; |
|
33 class MIMPSSharedData; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * IM client plug-in. |
|
38 * |
|
39 * IM project has responsibility to maintain / change implementation |
|
40 * of this class as they need. |
|
41 * |
|
42 * @since 2.1 |
|
43 */ |
|
44 NONSHARABLE_CLASS( CCnUiClientPluginIM ) : public CCnUiClientPluginBase |
|
45 |
|
46 { |
|
47 public: // Two-phased constructors and destructor |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 static CCnUiClientPluginIM* NewL( CPEngNWSessionSlotID2& aNWSessionSlotID ); |
|
53 |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~CCnUiClientPluginIM(); |
|
59 |
|
60 private: |
|
61 |
|
62 /** |
|
63 * C++ constructor. |
|
64 */ |
|
65 CCnUiClientPluginIM(); |
|
66 |
|
67 /** |
|
68 * Symbian OS constructor. |
|
69 */ |
|
70 void ConstructL( CPEngNWSessionSlotID2& aNWSessionSlotID ); |
|
71 |
|
72 |
|
73 |
|
74 private: //From MCnUiClientPlugin |
|
75 |
|
76 /** |
|
77 * From MCnUiClientPlugin |
|
78 * @see MCnUiClientPlugin |
|
79 * @since 2.1 |
|
80 */ |
|
81 TCnUiConnectionMode CurrentConnectionModeSettingL(); |
|
82 |
|
83 |
|
84 /** |
|
85 * From MCnUiClientPlugin |
|
86 * @see MCnUiClientPlugin |
|
87 * @since 2.1 |
|
88 */ |
|
89 void ReWakeAutomaticConnectionModeL(); |
|
90 |
|
91 |
|
92 /** |
|
93 * From MCnUiClientPlugin |
|
94 * Overloaded from CCnUiClientPluginBase |
|
95 * @see MCnUiClientPlugin |
|
96 * @since 2.1 |
|
97 */ |
|
98 void ConnectionOpenInitL( TBool aSapConnectionOpen, const CIMPSSAPSettings& aSap ); |
|
99 |
|
100 /** |
|
101 * From MCnUiClientPlugin |
|
102 * Overloaded from CCnUiClientPluginBase |
|
103 * @see MCnUiClientPlugin |
|
104 * @since 2.1 |
|
105 */ |
|
106 void LoginCancelledL(); |
|
107 |
|
108 public: //Template methods from CCnUiClientPluginBase |
|
109 |
|
110 /** |
|
111 * Template method from CCnUiClientPluginBase |
|
112 * @see CCnUiClientPluginBase |
|
113 * @since 2.1 |
|
114 */ |
|
115 TBool DoVerifySapCapabilities( TPEngWVCspServicesTree2 aCurrenServices ); |
|
116 |
|
117 |
|
118 /** |
|
119 * Template method from CCnUiClientPluginBase |
|
120 * @see CCnUiClientPluginBase |
|
121 * @since 2.1 |
|
122 */ |
|
123 CDesCArray* DoClientKnownCntListsLC(); |
|
124 |
|
125 |
|
126 /** |
|
127 * Template method from CCnUiClientPluginBase |
|
128 * @see CCnUiClientPluginBase |
|
129 * @since 2.1 |
|
130 */ |
|
131 void DoStartExplicitPostLoginSyncL(); |
|
132 |
|
133 /** |
|
134 * Template method from CCnUiClientPluginBase |
|
135 * @see CCnUiClientPluginBase |
|
136 * @since 2.1 |
|
137 */ |
|
138 void DoHandleExplicitPostLoginSyncStepCompleteL( TStepId aStepId, TInt& aStepStatus ); |
|
139 |
|
140 |
|
141 /** |
|
142 * Template method from CCnUiClientPluginBase |
|
143 * @see CCnUiClientPluginBase |
|
144 * @since 2.1 |
|
145 */ |
|
146 void DoStartPreLogoutPublishL(); |
|
147 |
|
148 |
|
149 /** |
|
150 * Template method from CCnUiClientPluginBase |
|
151 * @see CCnUiClientPluginBase |
|
152 * @since 2.1 |
|
153 */ |
|
154 void DoHandlePreLogoutPublishStepCompleteL( TStepId aStepId, TInt& aStepStatus ); |
|
155 |
|
156 private: // New helpers |
|
157 |
|
158 /** |
|
159 * Gets IM publish level value. |
|
160 * |
|
161 * @since 2.1 |
|
162 * @return IM setting value for attribute publishing |
|
163 */ |
|
164 static TInt IMAttributePublishLevelL(); |
|
165 |
|
166 /** |
|
167 * Updates IM attribute-lists if needed |
|
168 * @param aStatus Request status |
|
169 * @since 2.1 |
|
170 */ |
|
171 void UpdateIMAttributeListsL( TInt aPublishLevel, MDesCArray& aContactLists ); |
|
172 |
|
173 /** |
|
174 * Gets default attribute-list |
|
175 * @since 2.1 |
|
176 * @return Default attribute-list |
|
177 */ |
|
178 static MPEngAttributeList2* DefaultAttributeListLC( |
|
179 CPEngAttributeListStore2& aAttributeListFactory ); |
|
180 |
|
181 |
|
182 /** |
|
183 * Read IM Attributes from resource and set them |
|
184 * @since 3.0 |
|
185 * @param aLockedOwnAttributes |
|
186 * On return, contains list of locked own |
|
187 * attributes that should be published and unlocked. |
|
188 */ |
|
189 void ReadIMAttributesL( RPointerArray<MPEngPresenceAttrModel2>& aLockedOwnAttributes ); |
|
190 |
|
191 /** |
|
192 * Update local IM Attributes as given und issues NWE publish if needed |
|
193 * @since 2.1 |
|
194 * @param aStatus Request status |
|
195 */ |
|
196 void IssueIMAttributeUpdateAndPublishIfNeededL( TInt aPublishLevel ); |
|
197 |
|
198 /** |
|
199 * Opens correct resource file. |
|
200 * !!! Two items left to cleanup stack. !!! |
|
201 * @param aResourceFile Contains opened file on return |
|
202 * @since 3.0 |
|
203 */ |
|
204 void OpenResourceFileLC( RResourceFile& aResourceFile ); |
|
205 |
|
206 |
|
207 |
|
208 //Ease of IM Branding |
|
209 /** |
|
210 * Opens correct variation resource file. |
|
211 * !!! Two items left to cleanup stack. !!! |
|
212 * @param aResourceFile Contains opened file on return |
|
213 * @since 3.2 |
|
214 */ |
|
215 void OpenVariationResourceFileLC( RResourceFile& aResourceFile ); |
|
216 |
|
217 |
|
218 /** |
|
219 * Resource reader for non-Cone situations |
|
220 * @param aResourceId The integer-valued resource id to read |
|
221 * @return The value of the integer |
|
222 */ |
|
223 TInt ReadResourceIntValueL( TInt aResourceId ); |
|
224 |
|
225 /** |
|
226 * Calls ResetAndDestroy to given array |
|
227 * @since 3.0 |
|
228 * @param aObject Array (RPointerArray<MPEngPresenceAttrModel2>) |
|
229 */ |
|
230 static void DestroyCloseModelArray( TAny* aObject ); |
|
231 |
|
232 /** |
|
233 * Sets presence authorization to all |
|
234 * @since 3.0 |
|
235 */ |
|
236 void SetAuthorizationToAllL( MDesCArray& aContactLists ); |
|
237 |
|
238 /** |
|
239 * Sets presence authorization to none |
|
240 * @since 3.0 |
|
241 */ |
|
242 void SetAuthorizationToNoneL( MDesCArray& aContactLists ); |
|
243 |
|
244 /** |
|
245 * Sets presence authorization to friends |
|
246 * @since 3.0 |
|
247 */ |
|
248 void SetAuthorizationToFriendsL( |
|
249 MDesCArray& aContactLists ); |
|
250 |
|
251 /** |
|
252 * Attaches attribute list to contact lists |
|
253 * @since 3.0 |
|
254 */ |
|
255 void AttachAttributeListL( |
|
256 MDesCArray& aContactLists, |
|
257 MPEngAttributeList2& aAttributeList ); |
|
258 |
|
259 /** |
|
260 * Detaches attribute list from contact lists |
|
261 * @since 3.0 |
|
262 */ |
|
263 void DetachAttributeListL( MDesCArray& aContactLists ); |
|
264 |
|
265 /** |
|
266 * Get first status message for online state. |
|
267 * @return first status message from saved ones. |
|
268 * If not found, empty descriptor returned. |
|
269 * Ownership is transferred to caller. |
|
270 * @since 3.0 |
|
271 */ |
|
272 HBufC* GetFirstStatusMessageL() const; |
|
273 |
|
274 /** |
|
275 * Get sharedData attribute value. |
|
276 * @return Shared data string. |
|
277 * If not found, empty descriptor returned. |
|
278 * Ownership is transferred to caller. |
|
279 * @since 3.0 |
|
280 */ |
|
281 HBufC* GetSharedDataL( TIMPSSharedKeys aKey ) const; |
|
282 |
|
283 /** |
|
284 * Finds alias for given aUserID inside aAliasTable. |
|
285 * @param aAliasTable string containeing all aliases for different ids |
|
286 * @param aUserId Userid to look for |
|
287 * @param aIndex Position inside aAliasTable, where the wanted alias starts. |
|
288 * Or KErrNotFound |
|
289 * @param aLength aLength length of alias |
|
290 */ |
|
291 void LocateAliasL( const TDesC& aAliasTable, const TDesC& aUserId, |
|
292 TInt& aIndex, TInt& aLength ); |
|
293 |
|
294 private: // data |
|
295 |
|
296 // ETrue if reactive authorization is used |
|
297 TBool iRAUsed; |
|
298 |
|
299 // ETrue if alias attribute is supported |
|
300 TBool iAliasUsed; |
|
301 |
|
302 RFs iRFs; |
|
303 |
|
304 // ETrue if attribute lists are supported |
|
305 TBool iAttribListsSupported; |
|
306 |
|
307 // Presence authorization setting value |
|
308 TInt iPresenceAuth; |
|
309 |
|
310 // own. cached alias value |
|
311 HBufC* iAlias; |
|
312 |
|
313 //owns |
|
314 MIMPSSharedData* iSharedData; |
|
315 }; |
|
316 |
|
317 #endif //__CCNUICLIENTPLUGINIM_H |
|
318 // End of File |
|
319 |
|
320 |