00001 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 00002 // All rights reserved. 00003 // This component and the accompanying materials are made available 00004 // under the terms of "Eclipse Public License v1.0" 00005 // which accompanies this distribution, and is available 00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html". 00007 // 00008 // Initial Contributors: 00009 // Nokia Corporation - initial contribution. 00010 // 00011 // Contributors: 00012 // 00013 // Description: 00014 // 00015 00016 #ifndef __SMSEXAMPLE_H__ 00017 #define __SMSEXAMPLE_H__ 00018 00019 #include <txtrich.h> 00020 #include <txtfmlyr.h> 00021 #include <mtclreg.h> 00022 #include <msventry.h> 00023 #include <smuthdr.h> 00024 #include <e32cons.h> 00025 00029 class CExampleActive : public CActive 00030 { 00031 public: 00032 CExampleActive(); 00033 ~CExampleActive(); 00034 void StartL(); 00035 protected: 00036 void DoCancel(); 00037 void RunL(); 00038 }; 00039 00043 class CSessionObserver : public MMsvSessionObserver 00044 { 00045 public: 00046 virtual void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/){}; 00047 }; 00048 00052 class CSmsExample : public CBase 00053 { 00054 public: 00055 CSmsExample(); 00056 static CSmsExample* NewLC(); 00057 ~CSmsExample(); 00058 void SendReceiveSmsL(); 00059 private: 00060 void ConstructL(); 00061 void CreateSmsServiceL(); // create an SMS Service 00062 void ServiceIdL(TUid aMtm, TMsvId& aFirstId, CMsvEntrySelection* aServiceIds = NULL); 00063 void CreateMessageL(); // create an SMS message 00064 void DeleteMessagesL(TMsvId aFolder); 00065 void SetRecipientsL(CSmsHeader& aHeader); 00066 void DisplayMessagesL(TMsvId aId); 00067 void SendMessageL(); // send a message 00068 void ReceiveMessagesL(); // read the messages in the inbox 00069 00070 TBuf<220> GetUserInput(); 00071 public: 00072 CMsvSession* iSession; 00073 CSessionObserver* iSessionObserver; 00074 CMsvEntry* iMsvEntry; 00075 CMsvOperation* iOperation; 00076 TMsvId iMessageId; 00077 CMsvServerEntry* iServerEntry; 00078 CExampleActive* iActive; 00079 TMsvId iSmsServiceId; 00080 CRichText* iRichText; 00081 CSmsSettings* iServiceSettings; 00082 CSmsNumber* ircpt; 00083 CParaFormatLayer* iParaFormat; 00084 CCharFormatLayer* iCharFormat; 00085 CConsoleBase* iConsole; 00086 }; 00087 #endif // __SMSEXAMPLE_H__