|
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 * Description : |
|
13 * CCLCKCommandHandler class declaration for AT+CLCK command |
|
14 */ |
|
15 |
|
16 #ifndef CLCKCOMMANDHANDLER_H |
|
17 #define CLCKCOMMANDHANDLER_H |
|
18 |
|
19 #include <mmretrieve.h> |
|
20 |
|
21 #include "atmisccmdplugin.h" |
|
22 |
|
23 class CSecurityCodeVerifier; |
|
24 class CSecurityEventHandler; |
|
25 class CCBSettingHandler; |
|
26 |
|
27 enum TInfoClassMask |
|
28 { |
|
29 EInfoClassVoice = 1, // voice (telephony) |
|
30 EInfoClassData = 2, // data (refers to all bearer services; with <mode>=2 |
|
31 // this may refer only to some bearer service if TA does |
|
32 // not support values 16, 32, 64 and 128) |
|
33 EInfoClassFax = 4, // fax (facsimile services) |
|
34 EInfoClassSMS = 8, // short message service |
|
35 EInfoClassSyncData = 16, // data circuit sync |
|
36 EInfoClassASyncData = 32, // data circuit async |
|
37 EInfoClassPacketData = 64, // dedicated packet access |
|
38 EInfoClassPadAccess = 128 // dedicated PAD access |
|
39 }; |
|
40 |
|
41 /** |
|
42 * AT+CLCK command handler implementation class |
|
43 */ |
|
44 NONSHARABLE_CLASS( CCLCKCommandHandler ) : public CATCmdAsyncBase |
|
45 { |
|
46 public: |
|
47 static CCLCKCommandHandler* NewL(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone); |
|
48 ~CCLCKCommandHandler(); |
|
49 |
|
50 // Callback methods for helper objects |
|
51 void HandlePasswordVerification(TInt aError); |
|
52 void HandleSecurityEvent(TInt aError, RMobilePhone::TMobilePhoneSecurityEvent aSecurityEvent); |
|
53 |
|
54 private: |
|
55 /** |
|
56 * States for lock setting |
|
57 */ |
|
58 enum TLockSettingState |
|
59 { |
|
60 ELockSettingIdle = 0x01, |
|
61 ELockSettingRequested = 0x02, |
|
62 ELockSettingPasswordRequested = 0x03 |
|
63 }; |
|
64 |
|
65 enum TCLCKCommand |
|
66 { |
|
67 ECLCKUndefined = KErrNotFound, |
|
68 ECLCKLockSet = 0x01, |
|
69 ECLCKLockGet = 0x02, |
|
70 ECLCKBarringSet = 0x03, |
|
71 ECLCKBarringGet = 0x04 |
|
72 }; |
|
73 |
|
74 enum TCmdFacilityType |
|
75 { |
|
76 ECmdFacilityTypeUnknown = 0, |
|
77 ECmdFacilityTypeLock, |
|
78 ECmdFacilityTypeBarring, |
|
79 ECmdFacilityTypeAllBarring |
|
80 }; |
|
81 |
|
82 private: // methods from CActive |
|
83 virtual void RunL(); |
|
84 virtual void DoCancel(); |
|
85 // RunError not needed as RunL does not leave |
|
86 |
|
87 private: // methods from CATCmdAsyncBase |
|
88 virtual void HandleCommand( const TDesC8& aCmd, RBuf8& aReply, TBool aReplyNeeded ); |
|
89 virtual void HandleCommandCancel(); |
|
90 |
|
91 private: |
|
92 CCLCKCommandHandler(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone); |
|
93 void ConstructL(); |
|
94 |
|
95 TInt ParseCCLCKCommand(); |
|
96 void IssueCLCKCommand(); |
|
97 TInt ReceiveCBList(); |
|
98 |
|
99 private: |
|
100 CCBSettingHandler* iCBSettingHandler; |
|
101 CSecurityEventHandler* iSecurityEventHandler; |
|
102 CSecurityCodeVerifier* iSecurityCodeVerifier; |
|
103 CRetrieveMobilePhoneCBList* iCBRetrieve; |
|
104 |
|
105 RBuf8 iReply; |
|
106 |
|
107 TCLCKCommand iCLCKCommandType; |
|
108 RBuf8 iPassword; |
|
109 TInt iInfoClass; |
|
110 |
|
111 TLockSettingState iLockSettingState; |
|
112 RMobilePhone::TMobilePhoneLock iLockType; |
|
113 RMobilePhone::TMobilePhoneLockSetting iLockChange; |
|
114 RMobilePhone::TMobilePhoneSecurityCode iSecurityCode; |
|
115 |
|
116 RMobilePhone::TMobilePhoneLockInfoV1 iLockInfo; |
|
117 RMobilePhone::TMobilePhoneLockInfoV1Pckg iLockInfoPckg; |
|
118 |
|
119 RMobilePhone::TMobilePhoneCBCondition iCondition; |
|
120 RMobilePhone::TMobilePhoneCBChangeV1 iCBInfo; |
|
121 }; |
|
122 |
|
123 #endif // CLCKCOMMANDHANDLER_H |