|
1 /* |
|
2 * Copyright (c) 2002-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: Can be used to show "Send" list query and to create and send |
|
15 * messages via available sending services. Created messages are |
|
16 * sent directly or message editor is opened for editing, |
|
17 * depending on the type of the selected service. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 #ifndef CSENDUI_H |
|
25 #define CSENDUI_H |
|
26 |
|
27 #include <TSendingCapabilities.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CEikMenuPane; |
|
31 class CSendUiImpl; |
|
32 class CMessageData; |
|
33 class CSendingServiceInfo; |
|
34 |
|
35 #define KMaxStringLength 1024; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 |
|
40 /** |
|
41 * Offers "Send" pop-up list and message creation and sending services. |
|
42 * |
|
43 * Can be used to display "Send" list query and to create and send |
|
44 * messages via available services. Sending services can be based |
|
45 * on the MTM or ECom architecture. Created messages are sent |
|
46 * directly or message editor is opened for editing, depending on |
|
47 * the type of selected service. |
|
48 * |
|
49 * @lib SendUi.lib |
|
50 * @since Series 60 3.0 |
|
51 */ |
|
52 class CSendUi : public CBase |
|
53 { |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 */ |
|
59 IMPORT_C static CSendUi* NewL(); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 */ |
|
64 IMPORT_C static CSendUi* NewLC(); |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 IMPORT_C virtual ~CSendUi(); |
|
70 |
|
71 public: // New functions |
|
72 |
|
73 /** |
|
74 * Adds "Send" menu item to menupane. |
|
75 * |
|
76 * @since Series 60 3.0 |
|
77 * @param aMenuPane Menupane where the "Send" menu item should be added. |
|
78 * @param aIndex The place of the "Send" menu item in menupane. |
|
79 * @param aCommandId Command id for the "Send" menu item. |
|
80 * @param aRequiredCapabilities Capabilities required by services to be |
|
81 * shown in "Send" list query. If no capabilities are required |
|
82 * (KCapabilitiesForAllServices), all available services are |
|
83 * shown in "Send" list query. |
|
84 * @return None. |
|
85 */ |
|
86 IMPORT_C void AddSendMenuItemL( |
|
87 CEikMenuPane& aMenuPane, |
|
88 TInt aIndex, |
|
89 TInt aCommandId, |
|
90 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices ); |
|
91 |
|
92 /** |
|
93 * First displays "Send" pop-up 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 * "Send" pop-up list query can be manipulated in three ways. All three |
|
99 * methods can be 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 * Eg. If oversized file is intended to send, MMS is filtered away from |
|
110 * "Send" pop-up list. |
|
111 * |
|
112 * The third option is to set the array of service uids not wanted to |
|
113 * be shown in list query. These sending services are filtered away |
|
114 * even if those match to required capabilities. |
|
115 * |
|
116 * @since Series 60 3.0 |
|
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 aBioTypeUid BIO message type uid. Deprecated. |
|
127 * @param aLaunchEditorEmbedded ETrue if the editor should be launched |
|
128 * embedded. Otherwise the editor is launched stand-alone. |
|
129 * Note: some services sends the messages without launching the |
|
130 * editor at all. |
|
131 * @param aTitleText Title of the "Send" pop-up list query. If no title |
|
132 * is defined, then the localised default title "Send:" is used. |
|
133 * @return None. |
|
134 */ |
|
135 IMPORT_C void ShowQueryAndSendL( |
|
136 const CMessageData* aMessageData, |
|
137 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, |
|
138 CArrayFix<TUid>* aServicesToDim = NULL, |
|
139 TUid aBioTypeUid = KNullUid, |
|
140 TBool aLaunchEditorEmbedded = ETrue, |
|
141 const TDesC& aTitleText = KNullDesC ); |
|
142 |
|
143 /** |
|
144 * Displays "Send" pop-up list query and returns the user selection. |
|
145 * |
|
146 * "Send" pop-up list query can be manipulated in three ways. All three |
|
147 * methods can be 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 * Eg. If oversized file is intended to send, MMS is filtered away from |
|
158 * "Send" pop-up list. |
|
159 * |
|
160 * The third option is to set the array of service uids not wanted to |
|
161 * be shown in list query. These sending services are filtered away |
|
162 * even if those match to required capabilities. |
|
163 * |
|
164 * @since Series 60 3.0 |
|
165 * @param aMessageData Data for the message. Attachments are used for |
|
166 * content based filtering. |
|
167 * @param aRequiredCapabilities Capabilities required by sending services |
|
168 * to be shown in "Send" pop-up list query. If no capabilities are |
|
169 * required (KCapabilitiesForAllServices), all available services |
|
170 * are shown in "Send" pop-up list query. |
|
171 * @param aServicesToDim Array of service uids (service uid, service |
|
172 * provider's uid or service's TechnologyType) _NOT_ wanted to "Send" |
|
173 * list query. |
|
174 * See predefined sending service uids in SendUiConsts.h . |
|
175 * @param aTitleText Title of the "Send" pop-up list query. If no title |
|
176 * is defined, then the localised default title "Send:" is used. |
|
177 * @return Uid of the selected service (MTM or ECom). |
|
178 * KNullId is returned if user selects cancel. |
|
179 */ |
|
180 IMPORT_C TUid ShowSendQueryL( |
|
181 const CMessageData* aMessageData = NULL, |
|
182 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, |
|
183 CArrayFix<TUid>* aServicesToDim = NULL, |
|
184 const TDesC& aTitleText = KNullDesC ); |
|
185 |
|
186 /** |
|
187 * Creates the message and launches the editor for editing the message |
|
188 * or sends the message directly without opening the editor. |
|
189 * Functionality depends on the type of selected service. |
|
190 * |
|
191 * @since Series 60 3.0 |
|
192 * @param aServiceUid Uid of the sending service (MTM or ECom). |
|
193 * @param aMessageData Data for the message. |
|
194 * @param aBioTypeUid BIO message type uid. Deprecated. |
|
195 * @param aLaunchEditorEmbedded ETrue if the editor should be launched |
|
196 * embedded. Otherwise the editor is launched stand-alone. |
|
197 * Note: some sending services sends the messages without |
|
198 * launching the editor at all. |
|
199 * @return None. |
|
200 */ |
|
201 IMPORT_C void CreateAndSendMessageL( |
|
202 TUid aServiceUid, |
|
203 const CMessageData* aMessageData, |
|
204 TUid aBioTypeUid = KNullUid, |
|
205 TBool aLaunchEditorEmbedded = ETrue ); |
|
206 |
|
207 /** |
|
208 * Validates that service is available and has required capabilities. |
|
209 * For ex. can be used when calling application creates its own "Send" |
|
210 * menu. |
|
211 * @since Series 60 3.0 |
|
212 * @param aServiceUid Uid of the sending service (MTM or ECom). |
|
213 * @param aRequiredCapabilities Capabilities required for the sending |
|
214 * service. |
|
215 * @return ETrue if service is available and it has required |
|
216 * capabilities,otherwise EFalse. |
|
217 */ |
|
218 IMPORT_C TBool ValidateServiceL( |
|
219 TUid aServiceUid, |
|
220 TSendingCapabilities aRequiredCapabilities ); |
|
221 |
|
222 /** |
|
223 * Returns sending capabilities of the sending service. |
|
224 * @since Series 60 3.0 |
|
225 * @param aServiceUid Uid of the sending service (MTM or ECom). |
|
226 * @param aServiceCapabilities TSendingCapabilities of the sending |
|
227 * service as a return value. |
|
228 * @return Return KErrNone if successful, or one of the system wide |
|
229 * errors if unsuccessful. |
|
230 */ |
|
231 IMPORT_C TInt ServiceCapabilitiesL( |
|
232 TUid aServiceUid, |
|
233 TSendingCapabilities& aServiceCapabilities ); |
|
234 |
|
235 /** |
|
236 * Can be used to check if sending of bio message is supported. Deprecated. |
|
237 * @since Series 60 3.0 |
|
238 * @param aBioMessageUid Uid of the bio message. |
|
239 * @return: Returns always EFalse |
|
240 */ |
|
241 IMPORT_C TBool CanSendBioMessage( TUid aBioMessageUid ) const; |
|
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 IMPORT_C void AvailableServicesL( |
|
262 RPointerArray<CSendingServiceInfo>& aServiceList, |
|
263 TUid aServiceProvider = KNullUid); |
|
264 |
|
265 // Menu type enumeration |
|
266 enum TSendUiMenuType |
|
267 { |
|
268 ESendMenu, |
|
269 EWriteMenu |
|
270 }; |
|
271 |
|
272 /** |
|
273 * Adds menu item of given type to menupane. |
|
274 * |
|
275 * @since Series 60 3.0 |
|
276 * @param aMenuType Type of the menu, "ESendMenu" or "EWriteMenu" |
|
277 * @param aMenuPane Menupane where the menu item should be added. |
|
278 * @param aIndex The place of the menu item in menupane. |
|
279 * @param aCommandId Command id for the menu item. |
|
280 * @param aRequiredCapabilities Capabilities required from services to be |
|
281 * shown in list query. If no capabilities are required |
|
282 * (KCapabilitiesForAllServices), all available services are |
|
283 * shown in list query. |
|
284 * @return None. |
|
285 */ |
|
286 IMPORT_C void AddTypedMenuItemL( |
|
287 TSendUiMenuType aMenuType, |
|
288 CEikMenuPane& aMenuPane, |
|
289 TInt aIndex, |
|
290 TInt aCommandId, |
|
291 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices ); |
|
292 |
|
293 /** |
|
294 * Displays list query and creates message. |
|
295 * See ShowQueryAndSendL. |
|
296 * |
|
297 * @since Series 60 3.0 |
|
298 * @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu" |
|
299 * @param aMessageData Data for the message. |
|
300 * @param aRequiredCapabilities Capabilities required by sending services |
|
301 * to be shown in "Send" pop-up list query. If no capabilities are |
|
302 * required (KCapabilitiesForAllServices), all available services |
|
303 * are shown in "Send" pop-up list query. |
|
304 * @param aServicesToDim Array of service uids (service uid, service |
|
305 * provider's uid or service's TechnologyType) _NOT_ wanted to "Send" |
|
306 * list query. |
|
307 * See predefined sending service uids in SendUiConsts.h . |
|
308 * @param aBioTypeUid BIO message type uid. Deprecated. |
|
309 * @param aLaunchEditorEmbedded ETrue if the editor should be launched |
|
310 * embedded. Otherwise the editor is launched stand-alone. |
|
311 * Note: some services sends the messages without launching the |
|
312 * editor at all. |
|
313 * @param aTitleText Title of the list query. If no title is defined, |
|
314 * then the localised default title is used, e.g. "Send" or |
|
315 * "Write". |
|
316 * @return None. |
|
317 */ |
|
318 IMPORT_C void ShowTypedQueryAndSendL( |
|
319 TSendUiMenuType aMenuType, |
|
320 const CMessageData* aMessageData, |
|
321 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, |
|
322 CArrayFix<TUid>* aServicesToDim = NULL, |
|
323 TUid aBioTypeUid = KNullUid, |
|
324 TBool aLaunchEditorEmbedded = ETrue, |
|
325 const TDesC& aTitleText = KNullDesC ); |
|
326 |
|
327 /** |
|
328 * Displays list query and returns the user selection. |
|
329 * See ShowSendQueryL. |
|
330 * |
|
331 * @since Series 60 3.0 |
|
332 * @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu" |
|
333 * @param aMessageData Data for the message. Attachments are used for |
|
334 * content based filtering. |
|
335 * @param aRequiredCapabilities Capabilities required by sending services |
|
336 * to be shown in list query. If no capabilities are required |
|
337 * (KCapabilitiesForAllServices), all available services are |
|
338 * shown in list query. |
|
339 * @param aServicesToDim Array of service uids (service uid, service |
|
340 * provider's uid or service's TechnologyType) _NOT_ wanted to "Send" |
|
341 * list query. |
|
342 * See predefined sending service uids in SendUiConsts.h . |
|
343 * @param aTitleText Title of the list query. If no title is defined, |
|
344 * then the localised default title is used, e.g. "Send" or |
|
345 * "Write" |
|
346 * @return Uid of the selected service (MTM or ECom). |
|
347 * KNullId is returned if user selects cancel. |
|
348 */ |
|
349 IMPORT_C TUid ShowTypedQueryL( |
|
350 TSendUiMenuType aMenuType, |
|
351 const CMessageData* aMessageData = NULL, |
|
352 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, |
|
353 CArrayFix<TUid>* aServicesToDim = NULL, |
|
354 const TDesC& aTitleText = KNullDesC ); |
|
355 |
|
356 /** |
|
357 * Returns the technology type of a service |
|
358 * |
|
359 * @since Series 60 3.0 |
|
360 * @param aServiceId Service of interest |
|
361 * @return Technology type of the provided service. NULL if Mtm |
|
362 * service doesn't exist or service is ECOM based. |
|
363 */ |
|
364 IMPORT_C TUid TechnologyType( TUid aServiceUid ) const; |
|
365 |
|
366 private: |
|
367 |
|
368 /** |
|
369 * C++ default constructor. |
|
370 */ |
|
371 CSendUi(); |
|
372 |
|
373 /** |
|
374 * By default Symbian 2nd phase constructor is private. |
|
375 */ |
|
376 void ConstructL(); |
|
377 |
|
378 private: // Data |
|
379 // SendUi API implmentation. Owned. |
|
380 CSendUiImpl* iSendUiImpl; |
|
381 }; |
|
382 |
|
383 #endif // CSENDUI_H |
|
384 |
|
385 // End of File |