examples/SFExamples/symbian_os_communications_programming_book_v2/chapter9/SendWorkBench/SendWorkbenchUIQ/src/Sender.cpp

00001 // 
00002 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
00003 // All rights reserved.
00004 // This component and the accompanying materials are made available
00005 // under the terms of the License "Eclipse Public License v1.0"
00006 // which accompanies this distribution, and is available
00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00008 // 
00009 // Initial Contributors:
00010 // Nokia Corporation - initial contribution.
00011 // 
00012 // Contributors:
00013 // 
00014 // Description:
00015 // 
00016 
00017 #include "Sender.h"
00018 #include <rsendas.h>
00019 #include <rsendasmessage.h>
00020 #include <csendasmessagetypes.h>
00021 #include <smut.h>
00022 
00023 void Sender::EditAndSendSMSL()
00024         {
00025         _LIT(KSMSBodyText, "Some body text to fill up space");
00026 
00027         RSendAs sendAs;
00028         User::LeaveIfError(sendAs.Connect());
00029         CleanupClosePushL(sendAs);
00030         
00031         RSendAsMessage sendAsMessage;
00032         sendAsMessage.CreateL(sendAs, KUidMsgTypeSMS);
00033         CleanupClosePushL(sendAsMessage);
00034 
00035         // prepare the message
00036         sendAsMessage.SetBodyTextL(KSMSBodyText);
00037 
00038         // send the message
00039         sendAsMessage.LaunchEditorAndCloseL();
00040         sendAs.Close(); 
00041         CleanupStack::PopAndDestroy(2,&sendAs);
00042         }
00043                 
00044 
00045 void Sender::SendAnSMSL()
00046         {// Use your own test phone number of KSMSRecipient
00047         _LIT(KSMSRecipient, "+441234567890");
00048         _LIT(KSMSBodyText, "Some body text to fill up space");
00049 
00050         RSendAs sendAs;
00051         User::LeaveIfError(sendAs.Connect());
00052         CleanupClosePushL(sendAs);
00053         
00054         RSendAsMessage sendAsMessage;
00055         sendAsMessage.CreateL(sendAs, KUidMsgTypeSMS);
00056         CleanupClosePushL(sendAsMessage);
00057 
00058         // prepare the message
00059         sendAsMessage.AddRecipientL(KSMSRecipient,RSendAsMessage::ESendAsRecipientTo);
00060         sendAsMessage.SetBodyTextL(KSMSBodyText);
00061         // send the message
00062         sendAsMessage.SendMessageAndCloseL();
00063         CleanupStack::PopAndDestroy(2,&sendAs);
00064         }       
00065 

Generated by  doxygen 1.6.2