2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
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.
27 #include <TSendingCapabilities.h>
29 // FORWARD DECLARATIONS
33 class CSendingServiceInfo;
35 #define KMaxStringLength 1024;
41 * Offers "Send" pop-up list and message creation and sending services.
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.
50 * @since Series 60 3.0
52 class CSendUi : public CBase
54 public: // Constructors and destructor
57 * Two-phased constructor.
59 IMPORT_C static CSendUi* NewL();
62 * Two-phased constructor.
64 IMPORT_C static CSendUi* NewLC();
69 IMPORT_C virtual ~CSendUi();
71 public: // New functions
74 * Adds "Send" menu item to menupane.
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.
86 IMPORT_C void AddSendMenuItemL(
87 CEikMenuPane& aMenuPane,
90 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices );
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.
98 * "Send" pop-up list query can be manipulated in three ways. All three
99 * methods can be used or just some of those.
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.
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.
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.
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"
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
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.
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 );
144 * Displays "Send" pop-up list query and returns the user selection.
146 * "Send" pop-up list query can be manipulated in three ways. All three
147 * methods can be used or just some of those.
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.
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.
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.
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"
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.
180 IMPORT_C TUid ShowSendQueryL(
181 const CMessageData* aMessageData = NULL,
182 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices,
183 CArrayFix<TUid>* aServicesToDim = NULL,
184 const TDesC& aTitleText = KNullDesC );
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.
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.
201 IMPORT_C void CreateAndSendMessageL(
203 const CMessageData* aMessageData,
204 TUid aBioTypeUid = KNullUid,
205 TBool aLaunchEditorEmbedded = ETrue );
208 * Validates that service is available and has required capabilities.
209 * For ex. can be used when calling application creates its own "Send"
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
215 * @return ETrue if service is available and it has required
216 * capabilities,otherwise EFalse.
218 IMPORT_C TBool ValidateServiceL(
220 TSendingCapabilities aRequiredCapabilities );
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.
231 IMPORT_C TInt ServiceCapabilitiesL(
233 TSendingCapabilities& aServiceCapabilities );
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
241 IMPORT_C TBool CanSendBioMessage( TUid aBioMessageUid ) const;
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.
249 * Can be used for ex. when creating own "Send" menu, which needs to
250 * include ECom based services.
252 * NOTE: Can be used only for ECom based services, also for MTMs
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
261 IMPORT_C void AvailableServicesL(
262 RPointerArray<CSendingServiceInfo>& aServiceList,
263 TUid aServiceProvider = KNullUid);
265 // Menu type enumeration
273 * Adds menu item of given type to menupane.
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.
286 IMPORT_C void AddTypedMenuItemL(
287 TSendUiMenuType aMenuType,
288 CEikMenuPane& aMenuPane,
291 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices );
294 * Displays list query and creates message.
295 * See ShowQueryAndSendL.
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"
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
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
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 );
328 * Displays list query and returns the user selection.
329 * See ShowSendQueryL.
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"
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
346 * @return Uid of the selected service (MTM or ECom).
347 * KNullId is returned if user selects cancel.
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 );
357 * Returns the technology type of a service
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.
364 IMPORT_C TUid TechnologyType( TUid aServiceUid ) const;
369 * C++ default constructor.
374 * By default Symbian 2nd phase constructor is private.
379 // SendUi API implmentation. Owned.
380 CSendUiImpl* iSendUiImpl;