Namespaces
Variants
Actions

Sending files with SendUi

Jump to: navigation, search
Article Metadata

Compatibility
Platform(s): S60 2nd Edition and S60 3rd Edition (initial release)

Article
Created: symbianyucca (10 Apr 2007)
Last edited: hamishwillee (10 Dec 2012)

CSendUi API in 3rd edition and CSendAppUi API in pre-3rd edition is probably the easiest way on sending files from Symbian S60 devices. Note that it has internal protection against sending copy protected content, thus you can not send some files for example SIS files with it.

First define following member variables in your class definition:

#ifdef __SERIES60_3X__
CSendUi* iSendUi;
#else
CSendAppUi* iSendUi;
#endif

The indef with __SERIES60_3X__ will make sure that code compiled for 3rd edition will use CSendUi and other platforms will use CSendAppUi. Then to construct the SendUi instance, just add following lines into the ContsructL()-function of your class.

#ifdef __SERIES60_3X__
iSendUi = CSendUi::NewL();
#else
iSendUi = CSendAppUi::NewL(0);
#endif

Which after you can add your files to be sent into descriptor array and then you can use the following function to send the files out from the phone.

// Includes needed
#include <sendui.h>
#include <cmessagedata.h>
 
// Implementation>
void CreateAndSendMessageL(CDesCArray* aArray)
{
if(aArray && iSendUi)
{
TSendingCapabilities MySendCapa;
MySendCapa.iFlags = TSendingCapabilities::ESupportsAttachments;
 
if(aArray->Count())
{
#ifdef __SERIES60_3X__
CMessageData* Mymessage = CMessageData::NewLC();
 
for(TInt i=0; i< aArray->Count(); i++)
{
Mymessage->AppendAttachmentL(aArray->MdcaPoint(i));
}
 
TUid MyServiceUid = iSendUi->ShowSendQueryL(Mymessage,MySendCapa);
if(iSendUi->ValidateServiceL(MyServiceUid,MySendCapa))
{
iSendUi->CreateAndSendMessageL(MyServiceUid,Mymessage);
}
 
CleanupStack::PopAndDestroy( Mymessage);
#else
iSendUi->CreateAndSendMessagePopupQueryL(KtxApplicationName,MySendCapa,NULL,aArray);
#endif
 
}
}
}

The Sending function will cause SendUi to pop up selection list box filled with possible methods for sending the files, and selecting one will cause files to be sent with selected method.

This page was last modified on 10 December 2012, at 08:53.
85 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved