|
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 * CCMGDCommandHandler class declaration for AT+CMGD command |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CMGDCOMMANDHANDLER_H |
|
20 #define CMGDCOMMANDHANDLER_H |
|
21 |
|
22 #include "atcmdasyncbase.h" |
|
23 |
|
24 #include <etelmm.h> |
|
25 |
|
26 class CMobilePhoneGsmSmsList; |
|
27 class CRetrieveMobilePhoneSmsList; |
|
28 /** |
|
29 * AT+CMGD command handler implementation class |
|
30 */ |
|
31 NONSHARABLE_CLASS( CCMGDCommandHandler ) : public CATCmdAsyncBase |
|
32 { |
|
33 private: |
|
34 /** |
|
35 * States for CMGD command handler |
|
36 */ |
|
37 enum TCMGDState |
|
38 { |
|
39 ECMGDStateIdle, |
|
40 ECMGDStateRetrieveAllIndices, |
|
41 ECMGDStateDeleteOneEntry, |
|
42 ECMGDStateDeleteFilteredEntries, |
|
43 ECMGDStateDeleteAllEntries, |
|
44 ECMGDStateSimStoreNotSupported |
|
45 }; |
|
46 |
|
47 enum TCMGDFilter |
|
48 { |
|
49 ECMGDFilterReadMessagesOnly, |
|
50 ECMGDFilterReadAndSentMessages, |
|
51 ECMGDFilterReadSentAndUnsentMessages |
|
52 }; |
|
53 |
|
54 public: |
|
55 static CCMGDCommandHandler* NewL(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone); |
|
56 ~CCMGDCommandHandler(); |
|
57 |
|
58 private: // methods from CActive |
|
59 |
|
60 virtual void RunL(); |
|
61 virtual void DoCancel(); |
|
62 virtual TInt RunError(TInt aError); |
|
63 |
|
64 private: // methods from CATCmdAsyncBase |
|
65 |
|
66 virtual void HandleCommand( const TDesC8& aCmd, RBuf8& aReply, TBool aReplyNeeded ); |
|
67 |
|
68 private: |
|
69 |
|
70 CCMGDCommandHandler(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone); |
|
71 void ConstructL(); |
|
72 |
|
73 TInt ParseParameters(); |
|
74 TInt DoHandleCommand(); |
|
75 |
|
76 void GetMessageIndexListL(); |
|
77 void FilterMessageListL(); |
|
78 |
|
79 private: |
|
80 |
|
81 RMobileSmsMessaging iMobileSmsMessaging; |
|
82 RMobileSmsStore iMobileSmsStore; |
|
83 |
|
84 CRetrieveMobilePhoneSmsList* iRetrieveSmsList; |
|
85 CMobilePhoneGsmSmsList* iGsmSmsList; |
|
86 |
|
87 TCMGDState iHandlerState; |
|
88 TCMGDFilter iFilterType; |
|
89 TInt iIndex; |
|
90 TInt iDelFlag; |
|
91 RArray<TInt> iDeleteList; |
|
92 |
|
93 RBuf8 iReply; |
|
94 }; |
|
95 |
|
96 #endif /* CMGDCommandHandler_H */ |