diff -r 33a5d2bbf6fc -r 73a1feb507fb mmsharing/mmshengine/inc/musengtelephoneutils.h --- a/mmsharing/mmshengine/inc/musengtelephoneutils.h Thu Aug 19 09:51:39 2010 +0300 +++ b/mmsharing/mmshengine/inc/musengtelephoneutils.h Tue Aug 31 15:12:07 2010 +0300 @@ -27,22 +27,19 @@ #include #include #include -#include // FORWARD DECLARATIONS class CRepository; class CTelephonyAudioRouting; class CPhCltCommandHandler; class MMusEngAudioRoutingObserver; -class MMusEngVolumeChangeObserver; /** * Utility class to handle all phone related requests: * Audio routing, volume control and microphone muting. */ class CMusEngTelephoneUtils : public CActive, - public MTelephonyAudioRoutingObserver, - public MCenRepNotifyHandlerCallback + public MTelephonyAudioRoutingObserver { MUS_UNITTEST( UT_CMusEngTelephoneUtils ) MUS_UNITTEST( UT_CMusEngSession ) @@ -52,14 +49,14 @@ /** * */ - static CMusEngTelephoneUtils* NewL(); + static CMusEngTelephoneUtils* NewL( + MMusEngAudioRoutingObserver& aAudioRoutingObserver ); /** * */ ~CMusEngTelephoneUtils(); - public: // API /** @@ -67,29 +64,12 @@ * * @return ETrue if audio routing can be changed using LoudspeakerL */ - TBool AudioRoutingCanBeChanged() const; - - /** - * Checks if audio routing is headset - * - * @return ETrue if audio routing is headset - */ - TBool IsAudioRoutingHeadset() const; - - /** - * Checks if audio routing is LoudSpeaker - * - * @return ETrue if audio routing is LoudSpeaker and - * currentMode != iAudioOutputAtStartup - */ - TBool IsAudioRoutingLoudSpeaker() const; - + TBool AudioRoutingCanBeChanged(); + /** * Changes the audio routing between loudspeaker and handset. - * - * @param aShowDialog if ETrue, user is notified about new audio routing */ - void LoudspeakerL( TBool aEnable, TBool aShowDialog ); + void LoudspeakerL( TBool aEnable ); /** * @@ -97,15 +77,10 @@ TBool IsLoudSpeakerEnabled() const; /** - * Returns current CS call volume level from central repository + * */ TInt GetVolumeL() const; - /** - * Returns locally cached CS call volume level - */ - TInt GetVolume() const; - /** * */ @@ -119,19 +94,7 @@ /** * Returns current CS call mic mute state. */ - TBool IsMicMutedL(); - - /** - * Sets audio routing observer. Can be set to NULL in order to indicate - * ending of observing changes in audio routing. - */ - void SetAudioRoutingObserver( MMusEngAudioRoutingObserver* aObserver ); - - /** - * Sets volume level observer. Can be set to NULL in order to indicate - * ending of observing changes in volume level. - */ - void SetVolumeChangeObserver( MMusEngVolumeChangeObserver* aObserver ); + TBool IsMicMutedL(); private: // inherited from CActive @@ -139,7 +102,6 @@ * */ void RunL(); - TInt RunError( TInt aError ); /** * Cancels outstanding request to phone client @@ -153,37 +115,28 @@ * Available outputs have changed */ void AvailableOutputsChanged( - CTelephonyAudioRouting& aTelephonyAudioRouting ); + CTelephonyAudioRouting& aTelephonyAudioRouting ); /** * Some other application has changed audio output routing */ void OutputChanged( - CTelephonyAudioRouting& aTelephonyAudioRouting ); + CTelephonyAudioRouting& aTelephonyAudioRouting ); /** * Our request to change audio output routing has completed */ void SetOutputComplete( - CTelephonyAudioRouting& aTelephonyAudioRouting, - TInt aError ); - - /** - * Set output if setting is currently allowed. Leaves with KErrAccessDenied - * if setting is not allowed. - */ - void DoSetOutputL( CTelephonyAudioRouting::TAudioOutput aAudioOutput ); - - private:// From MCenRepNotifyHandlerCallback - - void HandleNotifyGeneric( TUint32 aId ); + CTelephonyAudioRouting& aTelephonyAudioRouting, + TInt aError ); private: /** * Default C++ constructor */ - CMusEngTelephoneUtils(); + CMusEngTelephoneUtils( + MMusEngAudioRoutingObserver& aAudioRoutingObserver ); /** * 2nd phase constructor @@ -200,14 +153,10 @@ */ TInt ValidateVolume( const TInt aVolume ) const; - /** - * Checks current volume level and notifies observer, if volume changed - * @param aAudioRouteChanged, ETrue if volume check should be done - * because of audio route change - */ - void UpdateCurrentVolume( TBool aAudioRouteChanged ); - + private: // DATA + + MMusEngAudioRoutingObserver& iAudioRoutingObserver; /** * Stores the audio routing state at startup. @@ -228,27 +177,6 @@ * Command handler for muting the microphone */ CPhCltCommandHandler* iPhoneCommandHandler; - - /** - * Not owned. - */ - MMusEngAudioRoutingObserver* iAudioRoutingObserver; - - TBool iShowDialog; - - /** - * Central repository notifier instance. Owned. - */ - CCenRepNotifyHandler* iNotifier; - - /** - * Volume change observer - * Used to inform session about volume updates - */ - MMusEngVolumeChangeObserver* iVolumeObserver; - - TInt iCurrentVolume; }; - -#endif // MUSENGTELEPHONEUTILS_H \ No newline at end of file +#endif // MUSENGTELEPHONEUTILS_H