×
Namespaces

Variants
Actions

Sending files with SendUi

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
CompatibilityArticle
Created: symbianyucca (10 Apr 2007)
Last edited: hamishwillee (30 May 2013)

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.

Version Hint

Windows Phone: [[Category:Windows Phone]]
[[Category:Windows Phone 7.5]]
[[Category:Windows Phone 8]]

Nokia Asha: [[Category:Nokia Asha]]
[[Category:Nokia Asha Platform 1.0]]

Series 40: [[Category:Series 40]]
[[Category:Series 40 1st Edition]] [[Category:Series 40 2nd Edition]]
[[Category:Series 40 3rd Edition (initial release)]] [[Category:Series 40 3rd Edition FP1]] [[Category:Series 40 3rd Edition FP2]]
[[Category:Series 40 5th Edition (initial release)]] [[Category:Series 40 5th Edition FP1]]
[[Category:Series 40 6th Edition (initial release)]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 Developer Platform 2.0]]

Symbian: [[Category:Symbian]]
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
[[Category:S60 5th Edition]]
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

This page was last modified on 30 May 2013, at 07:35.
47 page views in the last 30 days.