|
1 // smssend.h |
|
2 // |
|
3 // Copyright (c) 2008 - 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Accenture - Initial contribution |
|
11 // |
|
12 |
|
13 #ifndef __SMS_SEND_H__ |
|
14 #define __SMS_SEND_H__ |
|
15 |
|
16 #include <gsmubuf.h> |
|
17 #include <gsmumsg.h> |
|
18 #include <es_sock.h> |
|
19 #include <smsustrm.h> |
|
20 #include <smsuaddr.h> |
|
21 #include <mmretrieve.h> |
|
22 |
|
23 class MSmsSendObserver |
|
24 { |
|
25 public: |
|
26 virtual void SendComplete(const TInt aError) = 0; |
|
27 }; |
|
28 |
|
29 NONSHARABLE_CLASS(CSmsSender) : public CActive |
|
30 { |
|
31 public: |
|
32 static CSmsSender* NewL(RFs& aFs, MSmsSendObserver& aParent, const TDesC& aMsgToSend, const TDesC& aDestination); |
|
33 ~CSmsSender(); |
|
34 void StartL(); |
|
35 private: |
|
36 CSmsSender(MSmsSendObserver& aParent, RFs& aFs, const TDesC& aMsgToSend, const TDesC& aDestination); |
|
37 void ConstructL(); |
|
38 TInt GetServiceCentreAndSendSms(); |
|
39 void RetrieveServiceCentreL(); |
|
40 void CreateAndSendSmsL(); |
|
41 |
|
42 // From CActive |
|
43 void RunL(); |
|
44 void DoCancel(); |
|
45 private: |
|
46 MSmsSendObserver& iParent; |
|
47 RFs& iFs; |
|
48 const TDesC& iMsgContent; |
|
49 const TDesC& iDestination; |
|
50 CSmsBuffer* iMsgBuffer; |
|
51 CSmsMessage* iMsgToSend; |
|
52 RMobilePhone::TMobileAddress iServiceCentre; |
|
53 RTelServer iTelServer; |
|
54 RMobilePhone iPhone; |
|
55 RMobileSmsMessaging iMobileMessaging; |
|
56 CRetrieveMobilePhoneSmspList* iSmspList; |
|
57 RSocketServ iSocketServer; |
|
58 RSocket iSocket; |
|
59 TSmsAddr iSmsAddr; |
|
60 |
|
61 enum TSmsSenderState |
|
62 { |
|
63 ESmsSenderIdle, |
|
64 ESmsSenderGetServiceCentre, |
|
65 ESmsSenderSendMessage |
|
66 }; |
|
67 TSmsSenderState iState; |
|
68 }; |
|
69 |
|
70 #endif // __SMS_SEND_H__ |