bluetoothengine/headsetsimulator/profiles/hspprofile/inc/features/hspfeaturemanager.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 HSPFEATUREMANAGER_H_
       
    20 #define HSPFEATUREMANAGER_H_
       
    21 
       
    22 #include "hspfeaturecommons.h"
       
    23 #include "hspsettings.h"
       
    24 
       
    25 class CHsHSPCommand;
       
    26 class CHsHSPCallTerminationProc;
       
    27 class CHsHSPIncomingCallAcceptance;
       
    28 class CHsHSPRemoteAudioVolumeControl;
       
    29 
       
    30 /**
       
    31  * @brief Manages features supported by profile.
       
    32  * 
       
    33  * Delegates data handling to appropriate procedure and holds current state.
       
    34  */
       
    35 class CHsHSPFeatureManager : public CBase, public MHsHSPFeatureProviderObserver
       
    36 {
       
    37 public:
       
    38     /**
       
    39      * Two-phased constructor.
       
    40      * 
       
    41      * @return instance of class
       
    42      */
       
    43     static CHsHSPFeatureManager* NewL();
       
    44 
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      * 
       
    48      * @return instance of class
       
    49      */
       
    50     static CHsHSPFeatureManager* NewLC();
       
    51 
       
    52     /**
       
    53      * Destructor
       
    54      */
       
    55     ~CHsHSPFeatureManager();
       
    56 
       
    57 public:
       
    58     /**
       
    59      * Decides which procedure should be started.
       
    60      * 
       
    61      * @param aATCommandIn input AT command
       
    62      * @param aATCommandOut response
       
    63      */
       
    64     void PerformDataProcessingL( const CHsHSPCommand* aATCommandIn,
       
    65             CHsHSPCommand& aATCommandOut );
       
    66 
       
    67     /**
       
    68      * Handles AG's client disconnection event
       
    69      * 
       
    70      * @param aErr disconnection reason
       
    71      */
       
    72     void HandleClientDisconnected( TInt aErr );
       
    73 
       
    74     /**
       
    75      * Handles AG's client connection event
       
    76      * 
       
    77      * @param aCommandOut AT response
       
    78      */
       
    79     void HandleClientConnected( TDes8& aCommandOut );
       
    80 
       
    81 public:
       
    82     //Methods inherited from MHsHSPFeatureProviderObserver
       
    83     void HandleProcedureCompleted( TInt aErr, const THSPProcedure aProcedure );
       
    84 
       
    85 private:
       
    86     /**
       
    87      * Constructor for performing 1st stage construction
       
    88      */
       
    89     CHsHSPFeatureManager();
       
    90 
       
    91     /**
       
    92      * Constructor for performing 2nd stage construction
       
    93      */
       
    94     void ConstructL();
       
    95 
       
    96 private:
       
    97 
       
    98     /**
       
    99      * Handles <cr><lf> OK <cr><lf> command.
       
   100      * 
       
   101      * @param aATCommandIn input AT command
       
   102      * @param aATCommandOut response
       
   103      */
       
   104     void HandleOKCommandL( const CHsHSPCommand* aATCommandIn,
       
   105             CHsHSPCommand& aATCommandOut );
       
   106 
       
   107     /**
       
   108      * Handles +CKPD command 
       
   109      * 
       
   110      * @param aATCommandIn input AT command
       
   111      * @param aATCommandOut response
       
   112      */
       
   113     void HandleCKPDCommandL( const CHsHSPCommand* aATCommandIn,
       
   114             CHsHSPCommand& aATCommandOut );
       
   115 private:
       
   116 
       
   117     /** Ongoing procedure */
       
   118     THSPProcedure iProcedureStarted;
       
   119 
       
   120     /** Pointer to 'Terminate a call' feature. Owned */
       
   121     CHsHSPCallTerminationProc* iCallTermProc;
       
   122 
       
   123     /** Pointer to 'Accept an incoming voice call' feature. Owned */
       
   124     CHsHSPIncomingCallAcceptance* iCallAcceptProc;
       
   125 
       
   126     /** Pointer to 'Remote audio volume control' feature. Owned */
       
   127     CHsHSPRemoteAudioVolumeControl* iVolumeControl;
       
   128 
       
   129     /** Profile's settings */
       
   130     CHsHSPSettings* iSettings;
       
   131 
       
   132 };
       
   133 
       
   134 #endif /* HSPFEATUREMANAGER_H_ */