mmserv/callaudiocontrol/inc/CallAudioControlImpl.h
changeset 0 71ca22bcf22a
child 12 5a06f39ad45b
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2007 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 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Defines the interface to CallAudioControlImpl
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CALLAUDIOCONTROLIMPL_H
       
    19 #define CALLAUDIOCONTROLIMPL_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <TelephonyAudioRouting.h>
       
    24 #include <RoutingObserver.h>
       
    25 #include <UplinkGainObserver.h>
       
    26 #include <DownlinkVolumeObserver.h>
       
    27 #include <MTelephonyAudioRoutingObserver.h>
       
    28 #include <centralrepository.h>
       
    29 
       
    30 #ifdef __SERIES60_31__
       
    31 #include <TSEngInterface.h>
       
    32 #include <RPhCltServer.h> 
       
    33 #include <PhCltExt.h>       // link against PhoneClientExt.lib
       
    34 #include <MediatorCommandInitiator.h>
       
    35 #else
       
    36 #include <CPhCltCommandHandler.h> // wasn't introduced until 3.2
       
    37 #endif
       
    38 
       
    39 #include "CallAudioControlUtility.h"
       
    40 #include "CallAudioControl.h"
       
    41 
       
    42 // FORWARD DECLARATIONS
       
    43 class CRoutingObserver;
       
    44 class CCallAudioControlProperty;
       
    45 class CCallAudioControlRepository;
       
    46 
       
    47 // CLASS DECLARATION
       
    48 class CCallAudioControlImpl : public CBase
       
    49             , public MTelephonyAudioRoutingObserver
       
    50 #ifdef __SERIES60_31__
       
    51             , public MMediatorCommandResponseObserver
       
    52 #endif
       
    53     {
       
    54 
       
    55     public:  
       
    56 
       
    57         static CCallAudioControlImpl* NewL();
       
    58 
       
    59  		~CCallAudioControlImpl();
       
    60 
       
    61      	TInt AppendRoutingObserver( CRoutingObserver& aObserver ); 
       
    62      	TInt RemoveRoutingObserver( CRoutingObserver& aObserver );
       
    63 		TInt AppendDownlinkVolumeObserver( CDownlinkVolumeObserver& aObserver );
       
    64 		TInt RemoveDownlinkVolumeObserver( CDownlinkVolumeObserver& aObserver );
       
    65 		TInt AppendUplinkGainObserver( CUplinkGainObserver& aObserver );
       
    66 		TInt RemoveUplinkGainObserver( CUplinkGainObserver& aObserver );
       
    67 		TInt GetAvailableOutputs( RArray<CCallAudioControl::TAudioOutput>& aAvailableOutputs );
       
    68 		TInt GetOutput( CCallAudioControl::TAudioOutput& aOutput );
       
    69 		TInt SetOutput( CCallAudioControl::TAudioOutput aOutput );
       
    70 		TInt PreviousOutput( CCallAudioControl::TAudioOutput& aPrevOutput );
       
    71 		TInt GetMinDownlinkVolume( TUint& aVolume );
       
    72 		TInt GetDownlinkVolume( TUint& aVolume );
       
    73 		TInt GetMaxDownlinkVolume( TUint& aVolume );
       
    74 		TInt SetDownlinkVolume( TUint aVolume );
       
    75 		TInt GetUplinkMute( TBool& aMute );
       
    76     	TInt SetUplinkMute( TBool aMute );
       
    77 		void NotifyL(TAction aAction, TInt aError, TInt aValue);		    	
       
    78         
       
    79     private:
       
    80     
       
    81     	// For MTelephonyAudioRoutingObserver:
       
    82 		void AvailableOutputsChanged( CTelephonyAudioRouting& aTelephonyAudioRouting/*, const TArray<CTelephonyAudioRouting::TAudioOutput>& aOutputs*/);
       
    83 		void SetOutputComplete( CTelephonyAudioRouting& aTelephonyAudioRouting, TInt aErr);
       
    84   		void OutputChanged( CTelephonyAudioRouting& aTelephonyAudioRouting);   		  	
       
    85     	void ConstructL();
       
    86     	CCallAudioControlImpl();
       
    87 		TInt GetVolume(); 
       
    88 		TInt CheckIfOkToSetVolume();
       
    89 		TInt VerifyAndSetVolume(TInt aVolume);
       
    90 		TInt HandleCallStateChange();
       
    91 		TInt HandleEPVolumeChange(TInt aVolume);
       
    92 		TInt HandleIHFVolumeChange(TInt aVolume);
       
    93 		TInt HandleMuteChange(TBool aMute);
       
    94 		void NotifyVolumeObservers();
       
    95 		void NotifyGainObservers();	
       
    96 		void NotifyRoutingObservers(TUint aEvent, TInt aError);
       
    97 		void NotifyRoutingObservers(TUint aEvent);		
       
    98 		TInt SetMute(TBool aMute);
       
    99 		TBool IsCallActive();		
       
   100 #ifdef __SERIES60_31__
       
   101 		// For MMediatorCommandResponseObserver
       
   102 		void CommandResponseL( TUid /*aKMediatorSecondaryDisplayDomain*/, TUid /*aKTSECategory*/, 
       
   103                         TInt aCommandId,TInt aStatus, const TDesC8& /*aData*/ );				
       
   104 															   	
       
   105 #endif
       
   106     
       
   107     	// Data:
       
   108    		CTelephonyAudioRouting* iTelephonyAudioRouting;		
       
   109    		RPointerArray<CRoutingObserver> iRoutingObservers;
       
   110     	RPointerArray<CDownlinkVolumeObserver> iDownlinkVolumeObservers;
       
   111    		RPointerArray<CUplinkGainObserver> iUplinkGainObservers;    	  		
       
   112    		CCallAudioControl::TAudioOutput iCurrentAudioOutput;
       
   113    		CCallAudioControl::TAudioOutput iPreviousAudioOutput;
       
   114 		CCallAudioControlProperty* iCsNotifier;
       
   115 		CCallAudioControlRepository* iEpVolumeNotifier;
       
   116 		CCallAudioControlRepository* iIhfVolumeNotifier;
       
   117 		CCallAudioControlProperty* iMuteNotifier; 
       
   118 
       
   119 #ifdef __SERIES60_31__
       
   120  		CMediatorCommandInitiator* 	iCommandInitiator;
       
   121 	    RPhCltServer iPhoneClientServer;
       
   122 	    RLibrary iLibrary;
       
   123 #else
       
   124         CPhCltCommandHandler*   iPhoneClient;
       
   125 #endif 			  		  		
       
   126    		TInt iCallState;
       
   127 		TInt iVolume;
       
   128 		/* Needed to prevent notification going to the client modifying mute state */
       
   129         TBool iPendingMuteSetOp; /* Holds true if there is a pending setmute opreation */
       
   130         TBool iRequestedMuteState; /* Holds the current mute state */
       
   131         TBool iPendingEpVolLevelOp;
       
   132         TBool iRequestedEpVolLevel;
       
   133         TBool iPendingIhfVolLevelOp;
       
   134         TBool iRequestedIhfVolLevel;
       
   135 
       
   136 		
       
   137         TBool iWinsTesting;
       
   138     };
       
   139     
       
   140 #endif      // CALLAUDIOCONTROLIMPL_H
       
   141 
       
   142 // End of File