mmsharing/mmshengine/inc/musengtelephoneutils.h
branchRCL_3
changeset 11 ff8a573c0e2e
parent 0 f0cf47e981f9
child 21 ce86b6d44a6d
equal deleted inserted replaced
10:04980be5c5fe 11:ff8a573c0e2e
    25 // SYSTEM
    25 // SYSTEM
    26 #include <e32base.h>
    26 #include <e32base.h>
    27 #include <MTelephonyAudioRoutingObserver.h>
    27 #include <MTelephonyAudioRoutingObserver.h>
    28 #include <TelephonyAudioRouting.h>
    28 #include <TelephonyAudioRouting.h>
    29 #include <RPhCltServer.h>
    29 #include <RPhCltServer.h>
       
    30 #include <cenrepnotifyhandler.h>
    30 
    31 
    31 // FORWARD DECLARATIONS
    32 // FORWARD DECLARATIONS
    32 class CRepository;
    33 class CRepository;
    33 class CTelephonyAudioRouting;
    34 class CTelephonyAudioRouting;
    34 class CPhCltCommandHandler;
    35 class CPhCltCommandHandler;
    35 class MMusEngAudioRoutingObserver;
    36 class MMusEngAudioRoutingObserver;
       
    37 class MMusEngVolumeChangeObserver;
    36 
    38 
    37 /**
    39 /**
    38 * Utility class to handle all phone related requests:
    40 * Utility class to handle all phone related requests:
    39 * Audio routing, volume control and microphone muting.
    41 * Audio routing, volume control and microphone muting.
    40 */
    42 */
    41 class CMusEngTelephoneUtils : public CActive,
    43 class CMusEngTelephoneUtils : public CActive,
    42                               public MTelephonyAudioRoutingObserver
    44                               public MTelephonyAudioRoutingObserver,
       
    45                               public MCenRepNotifyHandlerCallback
    43     {
    46     {
    44     MUS_UNITTEST( UT_CMusEngTelephoneUtils )
    47     MUS_UNITTEST( UT_CMusEngTelephoneUtils )
    45     MUS_UNITTEST( UT_CMusEngSession )
    48     MUS_UNITTEST( UT_CMusEngSession )
    46 	
    49 	
    47 	public: 
    50 	public: 
    77    		*
    80    		*
    78         */
    81         */
    79 		TBool IsLoudSpeakerEnabled() const;
    82 		TBool IsLoudSpeakerEnabled() const;
    80 		
    83 		
    81 		/**
    84 		/**
    82    		*
    85    		* Returns current CS call volume level from central repository
    83         */
    86         */
    84 		TInt GetVolumeL() const;
    87 		TInt GetVolumeL() const;
    85 
    88 
       
    89         /**
       
    90         * Returns locally cached CS call volume level
       
    91         */
       
    92 		TInt GetVolume() const;
       
    93 		
    86 		/**
    94 		/**
    87    		*
    95    		*
    88         */
    96         */
    89 		void SetVolumeL( TInt aVolume );
    97 		void SetVolumeL( TInt aVolume );
    90 		
    98 		
   102         * Sets audio routing observer. Can be set to NULL in order to indicate
   110         * Sets audio routing observer. Can be set to NULL in order to indicate
   103         * ending of observing changes in audio routing.
   111         * ending of observing changes in audio routing.
   104         */
   112         */
   105         void SetAudioRoutingObserver( MMusEngAudioRoutingObserver* aObserver );
   113         void SetAudioRoutingObserver( MMusEngAudioRoutingObserver* aObserver );
   106                                         
   114                                         
       
   115         /**
       
   116         * Sets volume level observer. Can be set to NULL in order to indicate
       
   117         * ending of observing changes in volume level.
       
   118         */
       
   119         void SetVolumeChangeObserver( MMusEngVolumeChangeObserver* aObserver );
   107     
   120     
   108     private: // inherited from CActive
   121     private: // inherited from CActive
   109 
   122 
   110 		/**
   123 		/**
   111    		*
   124    		*
   143         * Set output if setting is currently allowed. Leaves with KErrAccessDenied
   156         * Set output if setting is currently allowed. Leaves with KErrAccessDenied
   144         * if setting is not allowed.
   157         * if setting is not allowed.
   145         */
   158         */
   146         void DoSetOutputL( CTelephonyAudioRouting::TAudioOutput aAudioOutput );
   159         void DoSetOutputL( CTelephonyAudioRouting::TAudioOutput aAudioOutput );
   147         
   160         
       
   161     private:// From MCenRepNotifyHandlerCallback
       
   162         
       
   163         void HandleNotifyGeneric( TUint32 aId );
       
   164         
   148     private:
   165     private:
   149 
   166 
   150 		/**
   167 		/**
   151    		* Default C++ constructor
   168    		* Default C++ constructor
   152         */
   169         */
   165    		*
   182    		*
   166    		* @return validated volume value
   183    		* @return validated volume value
   167         */
   184         */
   168 		TInt ValidateVolume( const TInt aVolume ) const;
   185 		TInt ValidateVolume( const TInt aVolume ) const;
   169 		
   186 		
   170 
   187 		/**
       
   188 		 * Checks current volume level and notifies observer, if volume changed
       
   189 		 * @param aAudioRouteChanged, ETrue if volume check should be done
       
   190 		 *        because of audio route change
       
   191 		 */
       
   192 		void UpdateCurrentVolume( TBool aAudioRouteChanged );
       
   193 		
   171     private: // DATA
   194     private: // DATA
   172 
   195 
   173         /**
   196         /**
   174         *  Stores the audio routing state at startup.
   197         *  Stores the audio routing state at startup.
   175         */
   198         */
   195         */
   218         */
   196         MMusEngAudioRoutingObserver* iAudioRoutingObserver;
   219         MMusEngAudioRoutingObserver* iAudioRoutingObserver;
   197 
   220 
   198         TBool iShowDialog;
   221         TBool iShowDialog;
   199         
   222         
       
   223         /**
       
   224          * Central repository notifier instance. Owned.
       
   225          */
       
   226         CCenRepNotifyHandler* iNotifier;
       
   227        
       
   228         /**
       
   229          * Volume change observer
       
   230          * Used to inform session about volume updates
       
   231          */
       
   232         MMusEngVolumeChangeObserver* iVolumeObserver;
       
   233         
       
   234         TInt iCurrentVolume;
   200     };
   235     };
   201 
   236 
   202 
   237 
   203 #endif // MUSENGTELEPHONEUTILS_H
   238 #endif // MUSENGTELEPHONEUTILS_H