bluetoothengine/headsetsimulator/profiles/hspprofile/inc/features/hspcalltermination.h
branchheadsetsimulator
changeset 60 90dbfc0435e3
equal deleted inserted replaced
59:02103bf20ee5 60:90dbfc0435e3
       
     1 /* 
       
     2  *
       
     3  * Copyright (c) <2010> Comarch S.A. and/or its subsidiary(-ies).
       
     4  * All rights reserved.
       
     5  * This component and the accompanying materials are made available
       
     6  * under the terms of the License "Eclipse Public License v1.0"
       
     7  * which accompanies this distribution, and is available
       
     8  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9  *
       
    10  * Original Contributors:
       
    11  * Comarch S.A. - original contribution.
       
    12  *
       
    13  * Contributors:
       
    14  *
       
    15  * Description:
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef HSPCALLTERMINATEPROC_H_
       
    20 #define HSPCALLTERMINATEPROC_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "hspfeaturecommons.h"
       
    25 
       
    26 class CHsHSPCommand;
       
    27 class CHsHSPSettings;
       
    28 
       
    29 /**
       
    30  * @brief Represents "Terminate a call" feature
       
    31  */
       
    32 class CHsHSPCallTerminationProc : public CBase, public MHsHSPProcedureCommons
       
    33 {
       
    34 public:
       
    35     /**
       
    36      * Two-phased constructor.
       
    37      * 
       
    38      * @param aObserver feature observer
       
    39      * 
       
    40      * @return instance of class
       
    41      */
       
    42     static CHsHSPCallTerminationProc* NewL(
       
    43             MHsHSPFeatureProviderObserver* aObserver );
       
    44 
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      * 
       
    48      * @param aObserver feature observer
       
    49      * 
       
    50      * @return instance of class
       
    51      */
       
    52     static CHsHSPCallTerminationProc* NewLC(
       
    53             MHsHSPFeatureProviderObserver* aObserver );
       
    54 
       
    55     /**
       
    56      * Destructor
       
    57      */
       
    58     ~CHsHSPCallTerminationProc();
       
    59 
       
    60 public:
       
    61     //Methods inherited from MHsHSPProcedureCommons
       
    62     TInt ProcessCommand( const CHsHSPCommand* aInputCmd,
       
    63             CHsHSPCommand &aOutputCmd );
       
    64 
       
    65 private:
       
    66     /**
       
    67      * Constructor for performing 1st stage construction
       
    68      * 
       
    69      * @param aObserver feature observer
       
    70      */
       
    71     CHsHSPCallTerminationProc( MHsHSPFeatureProviderObserver* aObserver );
       
    72 
       
    73     /**
       
    74      * Constructor for performing 2nd stage construction
       
    75      */
       
    76     void ConstructL();
       
    77 
       
    78 private:
       
    79 
       
    80     /**
       
    81      * Checks if received command is proper +CKPD
       
    82      * 
       
    83      * @param aCommand AT command
       
    84      * @return ETrue if command is AT+CKPD=200<cr><lf>, otherwise EFalse
       
    85      */
       
    86     TBool IsCKPD200( const CHsHSPCommand* aCommand );
       
    87 
       
    88     /**
       
    89      * Informs observer about procedure's completion
       
    90      * 
       
    91      * @param aErr error value
       
    92      */
       
    93     void InformObserver( TInt aErr );
       
    94 
       
    95 private:
       
    96 
       
    97     /** Procedure's type */
       
    98     const THSPProcedure iHSPProc = EHSPCallTerminate;
       
    99 
       
   100     /** Pointer to observer, not owned */
       
   101     MHsHSPFeatureProviderObserver* iObserver;
       
   102 
       
   103     /** Denotes if the next expected command is  <cr><lf> OK <cr><lf> */
       
   104     TBool iWaitingForOK;
       
   105 
       
   106 };
       
   107 
       
   108 #endif /* HSPCALLTERMINATEPROC_H_ */