author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 15:05:36 +0300 | |
branch | RCL_3 |
changeset 59 | d1d846af7341 |
parent 46 | d51193d814ea |
permissions | -rw-r--r-- |
46 | 1 |
/* |
2 |
* Copyright (c) 2002-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: SendUI API implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
||
21 |
||
22 |
#ifndef C_CSENDUIIMPL_H |
|
23 |
#define C_CSENDUIIMPL_H |
|
24 |
||
25 |
#include <f32file.h> |
|
26 |
#include <e32base.h> |
|
27 |
#include <e32property.h> |
|
28 |
#include <badesca.h> |
|
29 |
#include <ConeResLoader.h> |
|
30 |
#include <apaserverapp.h> |
|
31 |
#include <msvapi.h> |
|
32 |
||
33 |
#include <TSendingCapabilities.h> |
|
34 |
#include <sendui.h> |
|
35 |
#include <SendUiConsts.h> |
|
36 |
||
37 |
class CEikMenuPane; |
|
38 |
class CSendNormalUi; |
|
39 |
class CMessageData; |
|
40 |
class CSendingServiceManager; |
|
41 |
class CSendingServiceInfo; |
|
42 |
class RSendUiServiceClient; |
|
43 |
class CPropertyObserver; |
|
44 |
class TDataType; |
|
45 |
class CSendUiSingleton; |
|
46 |
class CSendUiAttachment; |
|
47 |
class CSendUiFileRightsEngine; |
|
48 |
||
49 |
/** |
|
50 |
* Implementation of SendUI API |
|
51 |
* |
|
52 |
* Can be used to show "Send" list query and to create and send |
|
53 |
* messages via available services. Sending services can be based |
|
54 |
* on the MTM or ECom architecture. Created messages are sent |
|
55 |
* directly or message editor is opened for editing, depending on |
|
56 |
* the type of selected service. |
|
57 |
* @lib sendui.lib |
|
58 |
* @since S60 v3.0 |
|
59 |
*/ |
|
60 |
class CSendUiImpl : public CBase |
|
61 |
{ |
|
62 |
friend class UT_CSendUiImpl; |
|
63 |
public: |
|
64 |
||
65 |
static CSendUiImpl* NewL(); |
|
66 |
||
67 |
virtual ~CSendUiImpl(); |
|
68 |
||
69 |
public: |
|
70 |
||
71 |
/** |
|
72 |
* Adds menu item of given type to menupane. |
|
59
d1d846af7341
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
73 |
* |
46 | 74 |
* @since Series 60 3.0 |
75 |
* @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu" |
|
76 |
* @param aMenuPane Menupane where the menu item should be added. |
|
77 |
* @param aIndex The place of the menu item in menupane. |
|
78 |
* @param aCommandId Command id for the menu item. |
|
79 |
* @param aRequiredCapabilities Capabilities required by services to be |
|
80 |
* shown in "Send" list query. If no capabilities are required |
|
81 |
* (KCapabilitiesForAllServices), all available services are |
|
82 |
* shown in "Send" list query. |
|
83 |
* @return None. |
|
84 |
*/ |
|
85 |
void AddTypedMenuItemL( |
|
86 |
CSendUi::TSendUiMenuType aMenuType, |
|
87 |
CEikMenuPane& aMenuPane, |
|
88 |
TInt aIndex, |
|
89 |
TInt aCommandId, |
|
90 |
TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices ); |
|
91 |
||
92 |
/** |
|
93 |
* First displays list query and then creates the message. |
|
94 |
* Editor is launched for editing the message or the message is sent |
|
95 |
* directly without opening the editor. Functionality depends on the |
|
96 |
* type of selected service. |
|
97 |
* |
|
98 |
* List query can be manipulated in three ways. All three methods can be |
|
99 |
* used or just some of those. |
|
100 |
* |
|
101 |
* The first option is to set the required capabilities for services. |
|
102 |
* Eg. attachments supported. Sending services not matching to required |
|
103 |
* capabilities are filtered away. Capabilities are defined in |
|
104 |
* TSendingCapabilities.h. |
|
105 |
* |
|
106 |
* The second option is content based filtering. Filtering is based on |
|
107 |
* the files intended to send. Those files can be set as part of message |
|
108 |
* data. Filtering is done according the predefined rules. |
|
109 |
* |
|
110 |
* The third option is to set the array of service uids not wanted to |
|
111 |
* be shown in list query. Uid can be the technology type, service provider or |
|
112 |
* service id. These sending services are filtered away |
|
113 |
* even if those match to required capabilities. |
|
114 |
* |
|
115 |
* @since Series 60 3.0 |
|
116 |
* @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu" |
|
117 |
* @param aMessageData Data for the message. |
|
118 |
* @param aRequiredCapabilities Capabilities required by sending services |
|
119 |
* to be shown in "Send" pop-up list query. If no capabilities are |
|
120 |
* required (KCapabilitiesForAllServices), all available services |
|
121 |
* are shown in "Send" pop-up list query. |
|
122 |
* @param aServicesToDim Array of service uids (service uid, service |
|
123 |
* provider's uid or service's TechnologyType) _NOT_ wanted to "Send" |
|
124 |
* list query. |
|
125 |
* See predefined sending service uids in SendUiConsts.h . |
|
126 |
* @param aLaunchEditorEmbedded ETrue if the editor should be launched |
|
127 |
* embedded. Otherwise the editor is launched stand-alone. |
|
128 |
* Note: some services sends the messages without launching the |
|
129 |
* editor at all. |
|
130 |
* @param aTitleText Title of the list query. If no title is defined, |
|
131 |
* then the localised default title is used, e.g. "Send" or |
|
132 |
* "Write". |
|
133 |
* @return None. |
|
134 |
*/ |
|
135 |
void ShowTypedQueryAndSendL( |
|
136 |
CSendUi::TSendUiMenuType aMenuType, |
|
137 |
const CMessageData* aMessageData, |
|
138 |
TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, |
|
139 |
CArrayFix<TUid>* aServicesToDim = NULL, |
|
140 |
TBool aLaunchEditorEmbedded = ETrue, |
|
141 |
const TDesC& aTitleText = KNullDesC ); |
|
142 |
||
143 |
/** |
|
144 |
* Displays list query and returns the user selection. |
|
145 |
* |
|
146 |
* List query can be manipulated in three ways. All three methods can be |
|
147 |
* used or just some of those. |
|
148 |
* |
|
149 |
* The first option is to set the required capabilities for services. |
|
150 |
* Eg. attachments supported. Sending services not matching to required |
|
151 |
* capabilities are filtered away. Capabilities are defined in |
|
152 |
* TSendingCapabilities.h. |
|
153 |
* |
|
154 |
* The second option is content based filtering. Filtering is based on |
|
155 |
* the files intended to send. Those files can be set as part of message |
|
156 |
* data. Filtering is done according the predefined rules. |
|
157 |
* |
|
158 |
* The third option is to set the array of service uids not wanted to |
|
159 |
* be shown in list query. These sending services are filtered away |
|
160 |
* even if those match to required capabilities. |
|
161 |
* |
|
162 |
* @since Series 60 3.0 |
|
163 |
* @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu" |
|
164 |
* @param aMessageData Data for the message. Attachments are used for |
|
165 |
* content based filtering. |
|
166 |
* @param aRequiredCapabilities Capabilities required by sending services |
|
167 |
* to be shown in list query. If no capabilities are required |
|
168 |
* (KCapabilitiesForAllServices), all available services are |
|
169 |
* shown in list query. |
|
170 |
* @param aServicesToDim Array of service uids (service uid, service |
|
171 |
* provider's uid or service's TechnologyType) _NOT_ wanted to "Send" |
|
172 |
* list query. |
|
173 |
* See predefined sending service uids in SendUiConsts.h . |
|
174 |
* @param aTitleText Title of the list query. If no title is defined, |
|
175 |
* then the localised default title is used, e.g. "Send" or |
|
176 |
* "Write" |
|
177 |
* @return Uid of the selected service (MTM or ECom). |
|
178 |
* KNullId is returned if user selects cancel. |
|
179 |
*/ |
|
180 |
TUid ShowTypedQueryL( |
|
181 |
CSendUi::TSendUiMenuType aMenuType, |
|
182 |
const CMessageData* aMessageData = NULL, |
|
183 |
TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, |
|
184 |
CArrayFix<TUid>* aServicesToDim = NULL, |
|
185 |
const TDesC& aTitleText = KNullDesC ); |
|
186 |
||
187 |
/** |
|
188 |
* Creates the message and launches the editor for editing the message |
|
189 |
* or sends the message directly without opening the editor. |
|
190 |
* Functionality depends on the type of selected service. |
|
191 |
* |
|
192 |
* @since Series 60 3.2 |
|
193 |
* @param aServiceUid Uid of the sending service. |
|
194 |
* @param aMessageData Data for the message. |
|
195 |
* @return None. |
|
196 |
*/ |
|
197 |
TInt SendMessageL( |
|
198 |
TUid aServiceUid, |
|
199 |
const CMessageData* aMessageData, |
|
200 |
TBool aLaunchEditorEmbedded ); |
|
201 |
||
202 |
/** |
|
203 |
* Launches server application, which will eventually call SendMessageL |
|
204 |
* with the same parameters. |
|
205 |
* |
|
206 |
* @since Series 60 3.2 |
|
207 |
* @param aServiceUid Uid of the sending service. |
|
208 |
* @param aMessageData Data for the message. |
|
209 |
* @return None. |
|
210 |
*/ |
|
211 |
void SendMessageViaServerL( |
|
212 |
TUid aServiceUid, |
|
213 |
const CMessageData* aMessageData, |
|
214 |
TBool aLaunchEditorEmbedded ); |
|
215 |
/** |
|
216 |
* Creates the message and launches the editor for editing the message |
|
217 |
* or sends the message directly without opening the editor. |
|
218 |
* Functionality depends on the type of selected service. |
|
219 |
* |
|
220 |
* @since Series 60 3.0 |
|
221 |
* @param aServiceUid Uid of the sending service. |
|
222 |
* @param aMessageData Data for the message. |
|
223 |
* @return None. |
|
224 |
*/ |
|
225 |
void CreateAndSendMessageL( |
|
226 |
TUid aServiceUid, |
|
227 |
const CMessageData* aMessageData, |
|
228 |
TBool aLaunchEditorEmbedded = ETrue ); |
|
229 |
||
230 |
/** |
|
231 |
* Returns sending capabilities of the sending service. |
|
232 |
* @since Series 60 3.0 |
|
233 |
* @param aServiceUid Uid of the sending service. |
|
234 |
* @param aServiceCapabilities TSendingCapabilities of the sending |
|
235 |
* service as a return value. |
|
236 |
* @return Return KErrNone if successful, or one of the system wide |
|
237 |
* errors if unsuccessful. |
|
238 |
*/ |
|
239 |
TInt ServiceCapabilities( |
|
240 |
TUid aServiceUid, |
|
241 |
TSendingCapabilities& aServiceCapabilities ); |
|
242 |
||
243 |
/** |
|
244 |
* Populates given list with the information about services |
|
245 |
* provided by specified ECom service provider. |
|
246 |
* Each service provider can provide 1..n services. |
|
247 |
* Ownership of the pointed objects are transfered to caller. |
|
248 |
* |
|
249 |
* Can be used for ex. when creating own "Send" menu, which needs to |
|
250 |
* include ECom based services. |
|
251 |
* |
|
252 |
* NOTE: Can be used only for ECom based services, also for MTMs |
|
253 |
* |
|
254 |
* @since Series 60 2.8 |
|
255 |
* @param aServiceList Service list to be populated. |
|
256 |
* @param aServiceProvider Id of the specified service provider. |
|
257 |
* KNullId means all service providers. |
|
258 |
* Service providers are defined in SendUiConsts.h |
|
259 |
* @return none |
|
260 |
*/ |
|
261 |
void AvailableServicesL( |
|
262 |
RPointerArray<CSendingServiceInfo>& aServiceList, |
|
263 |
TUid aServiceProvider = KNullUid); |
|
264 |
||
265 |
/** |
|
266 |
* Returns the technology type of a service |
|
267 |
* |
|
268 |
* @since Series 60 3.0 |
|
269 |
* @param aServiceId Service of interest |
|
270 |
* @return Technology type of the provided service. NULL if Mtm |
|
271 |
* service doesn't exist or service is ECOM based. |
|
272 |
*/ |
|
273 |
TUid TechnologyType( TUid aServiceUid ); |
|
274 |
||
275 |
/** |
|
276 |
* Returns the index of the service in service array |
|
277 |
* |
|
278 |
* @since Series 60 3.2 |
|
279 |
* @param aServiceId Service of interest |
|
280 |
* @return Index of a found service. Otherwise KErrNotFound. |
|
281 |
*/ |
|
282 |
TInt ResolveServiceIndex( TUid aUid ); |
|
283 |
||
284 |
/** |
|
285 |
* Compares service capabilities with the required capabilities |
|
286 |
* |
|
287 |
* @since S60 v3.2 |
|
288 |
* @param aServiceIndex Index of the service |
|
289 |
* @param aRequiredCapabilities Required capabilities |
|
290 |
* @return ETrue, if service has required or more capabilities. |
|
291 |
* EFalse, if service does not have the required capabilities |
|
292 |
* or service does not exist. |
|
293 |
*/ |
|
294 |
TBool QueryCapabilities( |
|
295 |
TInt aServiceIndex, |
|
296 |
TSendingCapabilities aCap ); |
|
297 |
||
298 |
/** |
|
299 |
* Copies sending service information from Central Repository to local data |
|
300 |
* |
|
301 |
* @since S60 v3.2 |
|
302 |
*/ |
|
303 |
void GetServicesL( ); |
|
304 |
||
305 |
//Functions introduced for CMail changes |
|
306 |
||
307 |
/** |
|
308 |
* Checks if Device has any mailbox or not |
|
309 |
* |
|
310 |
* @since S60 v5.0 |
|
311 |
* @param void |
|
312 |
* @return ETrue, if atleast one mailbox is available. |
|
313 |
* EFalse, if no mailbox are there |
|
314 |
*/ |
|
315 |
||
316 |
TBool IsMailboxAvailableL(void); |
|
317 |
||
318 |
/** |
|
319 |
* Checks if Device has any ThirdParty Mail Services or not |
|
320 |
* |
|
321 |
* @since S60 v5.0 |
|
322 |
* @param void |
|
323 |
* @return ETrue, if atleast one Third Party Service is available. |
|
324 |
* EFalse, if Third Party Service are there |
|
325 |
*/ |
|
326 |
||
327 |
TBool IsThirdPartyMailService(TUid aUid ); |
|
328 |
||
329 |
/** |
|
330 |
* Checks if Email entry is valid to be appended |
|
331 |
* |
|
332 |
* @since S60 v5.0 |
|
333 |
* @param void |
|
334 |
* @return ETrue, if it can be appended. |
|
335 |
* EFalse, if cannot be appended |
|
336 |
*/ |
|
337 |
||
338 |
TBool IsEmailAppendableL(TMsvEntry tentry); |
|
339 |
||
59
d1d846af7341
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
340 |
|
46 | 341 |
|
342 |
private: |
|
343 |
||
344 |
||
345 |
/** |
|
346 |
* |
|
347 |
* @since Series 60 3.0 |
|
348 |
* @param aListItems |
|
349 |
* @param aTitleText Title of the pop-up list query. If no title |
|
350 |
* is defined, then the localised default title is used. |
|
351 |
* @return: User selection. |
|
352 |
*/ |
|
353 |
TUid ShowListQueryL( |
|
354 |
MDesCArray* aListItems, |
|
355 |
const CArrayFix<TUid>& aListItemUids, |
|
356 |
const TDesC& aTitleText, |
|
357 |
CSendUi::TSendUiMenuType aMenuType ); |
|
358 |
||
359 |
/** |
|
360 |
* Filtering services by their content |
|
361 |
* |
|
362 |
* @since Series 60 3.0 |
|
363 |
* @param aServiceUid |
|
364 |
* @param aServiceProviderUid |
|
365 |
* @param aMessageData Message data, which is base of the content filtering. |
|
366 |
* @param aMimeType The mimetype of the first attachment. |
|
367 |
* @return: True, if given service can send specified content |
|
368 |
*/ |
|
369 |
TBool CanSendContentL( |
|
370 |
TUid aServiceUid, |
|
371 |
TUid aServiceProviderUid, |
|
372 |
const CMessageData* aMessageData, |
|
373 |
TDataType* aMimeType ); |
|
374 |
||
375 |
/** |
|
376 |
* |
|
377 |
* @since Series 60 3.0 |
|
378 |
* @param aListItemUids |
|
379 |
* @param aListItemUids |
|
380 |
* @param aRequiredCapabilities |
|
381 |
* @param aContentArray |
|
382 |
* @param aServicesToDim |
|
383 |
* @return: None. |
|
384 |
*/ |
|
385 |
void FilterServicesL( |
|
386 |
CDesCArrayFlat& aListItems, |
|
387 |
CArrayFix<TUid>& aListItemUids, |
|
388 |
TSendingCapabilities aRequiredCapabilities, |
|
389 |
const CMessageData* aMessageData, |
|
390 |
CSendUi::TSendUiMenuType aMenuType ); |
|
391 |
||
392 |
/** |
|
393 |
* Sorts service lists |
|
394 |
* |
|
395 |
* @since S60 v3.0 |
|
396 |
* @param aListItems Names of items in array |
|
397 |
* @param aListItemUids Uids of items in array |
|
398 |
* @return: Sorted array |
|
399 |
*/ |
|
400 |
void SortListL( |
|
401 |
CDesCArrayFlat& aListItems, |
|
402 |
CArrayFix<TUid>& aListItemUids ); |
|
403 |
||
404 |
/** |
|
405 |
* Resets sending state flag. |
|
406 |
* @since Series 60 3.0 |
|
407 |
* @return None. |
|
408 |
*/ |
|
409 |
static void ResetIsSending( TAny* aAny ); |
|
410 |
||
411 |
/** |
|
412 |
* Compares ECom service sending capabilities to required capabilities. |
|
413 |
* @since Series 60 3.0 |
|
414 |
* @param aServiceUid Uid of the sending service. |
|
415 |
* @param aRequiredCapabilities Capabilities required for the sending |
|
416 |
* service. |
|
417 |
* @return: ETrue if service sending capabilities matches to |
|
418 |
* required capabilities, otherwise EFalse. |
|
419 |
*/ |
|
420 |
TBool CheckServiceCapabilities( |
|
421 |
TUid aServiceUid, |
|
422 |
TSendingCapabilities aRequiredCapabilities ); |
|
423 |
||
424 |
/** |
|
425 |
* Checks if the feature is supported by feature manager. |
|
426 |
* @since Series 60 3.2.3 |
|
427 |
* @param aFeature Feature manager id of the sending service. |
|
428 |
* @param aNewFeatures To keep track of which feature is modified |
|
429 |
* @param aFeatureFlag Uid of the sending service used for central repository storage. |
|
430 |
* @return None |
|
431 |
*/ |
|
432 |
void FeatureStatus( |
|
433 |
TInt aFeature, |
|
434 |
TInt &aNewFeatures, |
|
435 |
TInt aFeatureFlag ); |
|
436 |
private: |
|
437 |
||
438 |
CSendUiImpl(); |
|
439 |
||
440 |
void ConstructL(); |
|
441 |
||
442 |
private: // data |
|
443 |
||
444 |
/** |
|
445 |
* Pointer to Control environment |
|
446 |
* Not own. |
|
447 |
*/ |
|
448 |
CCoeEnv* iCoeEnv; |
|
449 |
||
450 |
/** |
|
451 |
* Pointer to File Server Session. Initialized from CCoeEnv->FsSession. |
|
452 |
* Not own. |
|
453 |
*/ |
|
454 |
RFs& iFs; |
|
455 |
||
456 |
/** |
|
457 |
* Pointer to CSendUiSingleton |
|
458 |
* Own. |
|
459 |
*/ |
|
460 |
CSendUiSingleton* iSingleton; |
|
461 |
||
462 |
/** |
|
463 |
* Indicates whether or not the sending process is in progress. |
|
464 |
*/ |
|
465 |
TBool iIsSending; |
|
466 |
||
467 |
/** |
|
468 |
* For UI resource loading |
|
469 |
* Own. |
|
470 |
*/ |
|
471 |
RConeResourceLoader iResourceLoader; |
|
472 |
||
473 |
/** |
|
474 |
* Services to be dimmed |
|
475 |
* Own. |
|
476 |
*/ |
|
477 |
CArrayFixFlat<TUid>* iServicesToDim; |
|
478 |
||
479 |
/** |
|
480 |
* Resource file name and path. |
|
481 |
* Own. |
|
482 |
*/ |
|
483 |
TFileName iResourceFileName; |
|
484 |
||
485 |
||
486 |
TBool iEmailClientIntegration; |
|
487 |
||
488 |
/** |
|
489 |
* Variable to know if Cmail |
|
490 |
* Feature is on |
|
491 |
*/ |
|
492 |
TBool iEmailFramework; |
|
493 |
||
494 |
/** |
|
495 |
* Array of available sending service |
|
496 |
* Own. |
|
497 |
*/ |
|
498 |
RPointerArray<CSendingServiceInfo> iSendingServices; |
|
499 |
||
500 |
/** |
|
501 |
* IPC client with SendUiLauncherApp |
|
502 |
* Own. |
|
503 |
*/ |
|
504 |
RSendUiServiceClient* iSendUiClient; |
|
505 |
||
506 |
/** |
|
507 |
* The requested order of sending services in the menu. |
|
508 |
* Read from resources. |
|
509 |
* Own. |
|
510 |
*/ |
|
511 |
CArrayFixFlat<TInt32>* iSendUiServicesOrderArray; |
|
512 |
||
513 |
TBool iServerAppLaunch; |
|
514 |
||
515 |
CPropertyObserver* iPropertyObserver; |
|
516 |
||
517 |
}; |
|
518 |
||
519 |
#endif // C_CSENDUIIMPL_H |