With the Send UI API, you can allow the mobile device user to choose any message type available on the mobile device. This way, you do not need to know what message types are available.
It is also possible to limit the message types that the mobile device user can choose from.
To send a message to another device:
Create an instance of CSendUI to enable your application to use the functionality of the Send UI API.
Note: When you use the Send UI API, it automatically opens a message editor. If you want to send a message without opening an editor, see the MMS Client MTM API or the SendAs API in the Symbian OS Library.
Use CSendUi::AddSendMenuItemL to add the Send item to your options menu.
Create an instance of the CMessageData class. If you wish to open an editor without any content from your application, do not set any of the CMessageData parameters. If you wish to pass information from your application to the editor that opens, set the appropriate parameters of CMessageData.
Depending on your requirements, use one of the following methods to send your message:
CSendUi::ShowQueryAndSendL(). This presents a list of available services to the mobile device user. Selection of a service launches the appropriate message editor or sends the message as appropriate.
CSendUi::CreateAndSendMessageL(). This sends the message contained in CMessageData by a specified service. Depending on the selected service, this may launch a message editor, which is populated with the content in CMessageData, to allow the mobile device user to edit the contents before sending the message.
CSendUi::ShowSendQueryL(). This displays a list of possible services and allows the mobile device user to choose one of them.
After using ShowSendQueryL, you also need to use CSendUi::ValidateServiceL() to check that the selected service works with the message constructed.
If you wish to limit the options presented to the mobile device user, use TSendingCapabilities::TSendingFlags to define which capabilities your message requires - or specify the UIDs of the services that should not be offered.
You can find the service UIDs in the header senduiconsts.h. For more information on UIDs, see How to use UIDs in the Symbian OS Library.
Include sendui.h
and senduiconsts.h
in
the appropriate class file(s).
The senduiconsts.h
header file defines the constants
for available messaging services from which you can choose.
Make sure you have the correct capabilities for the classes you are using.
Make sure sendui.lib
is
accessible to your linker when compiling your application by including it
in your application mmp file or by editing the project properties in your
IDE, depending on your build environment.
For information on mmp files, project properties, IDE, and the build environment, see Getting started.
For more information, see Additional information on sending a message and Related S60 APIs in Sending a message.