cbsatplugin/atmisccmdplugin/inc/clckcommandhandler.h
author hgs
Mon, 12 Jul 2010 19:13:27 +0300
changeset 44 6d10bd0d821a
parent 32 19bd632b5100
permissions -rw-r--r--
201027
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
 * All rights reserved.
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
 * Initial Contributors:
hgs
parents:
diff changeset
     9
 * Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    10
 *
hgs
parents:
diff changeset
    11
 * Contributors:
hgs
parents:
diff changeset
    12
 * Description :
hgs
parents:
diff changeset
    13
 * CCLCKCommandHandler class declaration for AT+CLCK command
hgs
parents:
diff changeset
    14
 */
hgs
parents:
diff changeset
    15
hgs
parents:
diff changeset
    16
#ifndef CLCKCOMMANDHANDLER_H
hgs
parents:
diff changeset
    17
#define CLCKCOMMANDHANDLER_H
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
#include <mmretrieve.h>
hgs
parents:
diff changeset
    20
32
hgs
parents: 26
diff changeset
    21
#include "atcmdasyncbase.h"
26
hgs
parents:
diff changeset
    22
hgs
parents:
diff changeset
    23
class CSecurityCodeVerifier;
hgs
parents:
diff changeset
    24
class CSecurityEventHandler;
hgs
parents:
diff changeset
    25
class CCBSettingHandler;
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
enum TInfoClassMask
hgs
parents:
diff changeset
    28
    {
hgs
parents:
diff changeset
    29
    EInfoClassVoice      = 1,   // voice (telephony) 
hgs
parents:
diff changeset
    30
    EInfoClassData       = 2,   // data (refers to all bearer services; with <mode>=2
hgs
parents:
diff changeset
    31
                                // this may refer only to some bearer service if TA does
hgs
parents:
diff changeset
    32
                                // not support values 16, 32, 64 and 128)
hgs
parents:
diff changeset
    33
    EInfoClassFax        = 4,   // fax (facsimile services)
hgs
parents:
diff changeset
    34
    EInfoClassSMS        = 8,   // short message service
hgs
parents:
diff changeset
    35
    EInfoClassSyncData   = 16,  // data circuit sync
hgs
parents:
diff changeset
    36
    EInfoClassASyncData  = 32,  // data circuit async
hgs
parents:
diff changeset
    37
    EInfoClassPacketData = 64,  // dedicated packet access
hgs
parents:
diff changeset
    38
    EInfoClassPadAccess  = 128  // dedicated PAD access
hgs
parents:
diff changeset
    39
    };
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
/**
hgs
parents:
diff changeset
    42
 *  AT+CLCK command handler implementation class
hgs
parents:
diff changeset
    43
 */
hgs
parents:
diff changeset
    44
NONSHARABLE_CLASS( CCLCKCommandHandler ) : public CATCmdAsyncBase
hgs
parents:
diff changeset
    45
    {
hgs
parents:
diff changeset
    46
public:
hgs
parents:
diff changeset
    47
    static CCLCKCommandHandler* NewL(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone);
hgs
parents:
diff changeset
    48
    ~CCLCKCommandHandler();
hgs
parents:
diff changeset
    49
    
hgs
parents:
diff changeset
    50
    // Callback methods for helper objects
hgs
parents:
diff changeset
    51
    void HandlePasswordVerification(TInt aError);
hgs
parents:
diff changeset
    52
    void HandleSecurityEvent(TInt aError, RMobilePhone::TMobilePhoneSecurityEvent aSecurityEvent);
hgs
parents:
diff changeset
    53
    
hgs
parents:
diff changeset
    54
private:
hgs
parents:
diff changeset
    55
    /**
hgs
parents:
diff changeset
    56
     * States for lock setting
hgs
parents:
diff changeset
    57
     */
hgs
parents:
diff changeset
    58
    enum TLockSettingState
hgs
parents:
diff changeset
    59
        {
hgs
parents:
diff changeset
    60
        ELockSettingIdle = 0x01,
hgs
parents:
diff changeset
    61
        ELockSettingRequested = 0x02,
hgs
parents:
diff changeset
    62
        ELockSettingPasswordRequested = 0x03
hgs
parents:
diff changeset
    63
        };
hgs
parents:
diff changeset
    64
    
hgs
parents:
diff changeset
    65
    enum TCLCKCommand
hgs
parents:
diff changeset
    66
        {
hgs
parents:
diff changeset
    67
        ECLCKUndefined  = KErrNotFound,
hgs
parents:
diff changeset
    68
        ECLCKLockSet    = 0x01,
hgs
parents:
diff changeset
    69
        ECLCKLockGet    = 0x02,
hgs
parents:
diff changeset
    70
        ECLCKBarringSet = 0x03,
hgs
parents:
diff changeset
    71
        ECLCKBarringGet = 0x04
hgs
parents:
diff changeset
    72
        };
hgs
parents:
diff changeset
    73
    
hgs
parents:
diff changeset
    74
    enum TCmdFacilityType
hgs
parents:
diff changeset
    75
        {
hgs
parents:
diff changeset
    76
        ECmdFacilityTypeUnknown = 0,
hgs
parents:
diff changeset
    77
        ECmdFacilityTypeLock,
hgs
parents:
diff changeset
    78
        ECmdFacilityTypeBarring,
hgs
parents:
diff changeset
    79
        ECmdFacilityTypeAllBarring
hgs
parents:
diff changeset
    80
        };
hgs
parents:
diff changeset
    81
    
hgs
parents:
diff changeset
    82
private: // methods from CActive
hgs
parents:
diff changeset
    83
    virtual void RunL();
hgs
parents:
diff changeset
    84
    virtual void DoCancel();
hgs
parents:
diff changeset
    85
    // RunError not needed as RunL does not leave
hgs
parents:
diff changeset
    86
32
hgs
parents: 26
diff changeset
    87
private: // method from CATCmdAsyncBase::MATCmdBase    
26
hgs
parents:
diff changeset
    88
    virtual void HandleCommand( const TDesC8& aCmd, RBuf8& aReply, TBool aReplyNeeded );
32
hgs
parents: 26
diff changeset
    89
   
26
hgs
parents:
diff changeset
    90
private:
hgs
parents:
diff changeset
    91
    CCLCKCommandHandler(MATMiscCmdPlugin* aCallback, TAtCommandParser& aATCmdParser, RMobilePhone& aPhone);
hgs
parents:
diff changeset
    92
    void ConstructL();
hgs
parents:
diff changeset
    93
    
hgs
parents:
diff changeset
    94
    TInt ParseCCLCKCommand();
hgs
parents:
diff changeset
    95
    void IssueCLCKCommand();
hgs
parents:
diff changeset
    96
    TInt ReceiveCBList();
hgs
parents:
diff changeset
    97
hgs
parents:
diff changeset
    98
private:
hgs
parents:
diff changeset
    99
    CCBSettingHandler* iCBSettingHandler;
hgs
parents:
diff changeset
   100
    CSecurityEventHandler* iSecurityEventHandler;
hgs
parents:
diff changeset
   101
    CSecurityCodeVerifier* iSecurityCodeVerifier; 
hgs
parents:
diff changeset
   102
    CRetrieveMobilePhoneCBList* iCBRetrieve;
hgs
parents:
diff changeset
   103
hgs
parents:
diff changeset
   104
    RBuf8 iReply;
hgs
parents:
diff changeset
   105
hgs
parents:
diff changeset
   106
    TCLCKCommand iCLCKCommandType;
hgs
parents:
diff changeset
   107
    RBuf8 iPassword;
hgs
parents:
diff changeset
   108
    TInt iInfoClass;
hgs
parents:
diff changeset
   109
    
hgs
parents:
diff changeset
   110
    TLockSettingState iLockSettingState;
hgs
parents:
diff changeset
   111
    RMobilePhone::TMobilePhoneLock iLockType;
hgs
parents:
diff changeset
   112
    RMobilePhone::TMobilePhoneLockSetting iLockChange;
hgs
parents:
diff changeset
   113
    RMobilePhone::TMobilePhoneSecurityCode iSecurityCode;
hgs
parents:
diff changeset
   114
    
hgs
parents:
diff changeset
   115
    RMobilePhone::TMobilePhoneLockInfoV1 iLockInfo;
hgs
parents:
diff changeset
   116
    RMobilePhone::TMobilePhoneLockInfoV1Pckg iLockInfoPckg;
hgs
parents:
diff changeset
   117
    
hgs
parents:
diff changeset
   118
    RMobilePhone::TMobilePhoneCBCondition iCondition;
hgs
parents:
diff changeset
   119
    RMobilePhone::TMobilePhoneCBChangeV1 iCBInfo;
hgs
parents:
diff changeset
   120
    };
hgs
parents:
diff changeset
   121
hgs
parents:
diff changeset
   122
#endif // CLCKCOMMANDHANDLER_H