1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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 * Initial Contributors: |
|
9 * Nokia Corporation - initial contribution. |
|
10 * |
|
11 * Contributors: |
|
12 * |
|
13 * Description : |
|
14 * |
|
15 * CMGWCommandHandler class declaration for AT+CMGW command |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CMGWCOMMANDHANDLER_H |
|
20 #define CMGWCOMMANDHANDLER_H |
|
21 |
|
22 #include "atcmdasyncbase.h" |
|
23 |
|
24 #include <etel3rdparty.h> |
|
25 #include <etelmm.h> |
|
26 |
|
27 class CRetrieveMobilePhoneSmspList; |
|
28 class CMobilePhoneSmspList; |
|
29 |
|
30 /** |
|
31 * AT+CMGW command handler implementation class |
|
32 */ |
|
33 NONSHARABLE_CLASS( CCMGWCommandHandler ) : public CATCmdAsyncBase |
|
34 { |
|
35 private: |
|
36 enum TCMGWState |
|
37 { |
|
38 ECMGWStateIdle, // Idle |
|
39 ECMGWStateEditMode, // Edit mode |
|
40 ECMGWStateRetrieveSCA, // Retrieve SCA |
|
41 ECMGWStatePreparePDU, |
|
42 ECMGWStateWritePDU, // Write PDU |
|
43 ECMGWStateSimStoreNotSupported // Sim store not supported |
|
44 }; |
|
45 |
|
46 public: |
|
47 static CCMGWCommandHandler* NewL(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone); |
|
48 ~CCMGWCommandHandler(); |
|
49 |
|
50 void SetMessageFormat(TInt aFormat); |
|
51 |
|
52 private: // methods from CActive |
|
53 virtual void RunL(); |
|
54 virtual void DoCancel(); |
|
55 virtual TInt RunError (TInt aError); |
|
56 |
|
57 private: // methods from CATCmdAsyncBase |
|
58 virtual void HandleCommand( const TDesC8& aCmd, RBuf8& aReply, TBool aReplyNeeded ); |
|
59 |
|
60 private: |
|
61 CCMGWCommandHandler(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone); |
|
62 void ConstructL(); |
|
63 |
|
64 void HandleEditModeCommand( const TDesC8& aCmd ); |
|
65 TInt ParseParameters(); |
|
66 TInt CreateSmsEntry(); |
|
67 TInt ExtractSCA(); |
|
68 |
|
69 private: |
|
70 RMobileSmsMessaging iMobileSmsMessaging; |
|
71 RMobileSmsStore iMobileSmsStore; |
|
72 CRetrieveMobilePhoneSmspList* iRetrieveMobilePhoneSmspList; |
|
73 CMobilePhoneSmspList* iMobilePhoneSmspList; |
|
74 RMobileSmsMessaging::TMobileSmspEntryV1 iMobileSmspEntry; |
|
75 |
|
76 RMobilePhone::TMobileAddress iServiceCentre; |
|
77 |
|
78 TCMGWState iState; |
|
79 RBuf8 iTPDU; |
|
80 |
|
81 TInt iTPDULength; |
|
82 TInt iTPDUStat; |
|
83 TUint8 iSCALength; |
|
84 RMobileSmsStore::TMobileSmsStoreStatus iMessageStatus; |
|
85 |
|
86 RMobileSmsStore::TMobileGsmSmsEntryV1 iEntry; |
|
87 RMobileSmsStore::TMobileGsmSmsEntryV1Pckg iEntryPckg; |
|
88 |
|
89 RBuf8 iReply; |
|
90 |
|
91 TInt iMsgFormat; |
|
92 }; |
|
93 |
|
94 #endif /* CMGWCOMMANDHANDLER_H */ |
|