sl@0: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: #ifndef __MMFBTDEVSOUNDEVENTHANDLER_H sl@0: #define __MMFBTDEVSOUNDEVENTHANDLER_H sl@0: sl@0: #include sl@0: #include sl@0: #include "MmfBtPolicyClientServer.h" sl@0: sl@0: class CMMFDevSoundSessionXtnd; sl@0: sl@0: class RMMFAudioPolicyProxy; sl@0: sl@0: sl@0: class TMMFAudioPolicyEvent sl@0: { sl@0: public: sl@0: /** sl@0: Constructor. sl@0: sl@0: @internalTechnology sl@0: sl@0: @param "aEventType" "A code to define the type of event." sl@0: @param "aErrorCode" "The error code associated with the event." sl@0: @since 7.0s sl@0: */ sl@0: // TMMFAudioPolicyEvent(TAudioPolicyEventType aEventType, TInt aErrorCode) : iEventType(aEventType), iErrorCode(aErrorCode) {}; sl@0: sl@0: /** sl@0: Default constructor. sl@0: sl@0: Provided so this class can be packaged in a TPckgBuf<>. sl@0: @since 7.0s sl@0: */ sl@0: TMMFAudioPolicyEvent() : iEventType(EMMFAudioPolicyNoEvent), iErrorCode(KErrNone) {}; sl@0: sl@0: enum TAudioPolicyEventType sl@0: { sl@0: EMMFAudioPolicyNoEvent = 0, sl@0: EMMFAudioPolicySwitchToIdle, sl@0: EMMFAudioPolicyPriorityTooLow, sl@0: EMMFAudioPolicyResourceNotification sl@0: }; sl@0: sl@0: TAudioPolicyEventType iEventType; sl@0: TInt iErrorCode; sl@0: TMMFAudioPolicyState iState; sl@0: sl@0: }; sl@0: sl@0: typedef TPckgBuf TMMFAudioPolicyEventPckg; sl@0: sl@0: class CMMFDevSoundEventHandler : public CActive sl@0: /** sl@0: *@internalTechnology sl@0: */ sl@0: { sl@0: public: sl@0: static CMMFDevSoundEventHandler* NewL(RMMFAudioPolicyProxy* aAudioPolicyProxy); sl@0: ~CMMFDevSoundEventHandler(); sl@0: void ReceiveEvents(); sl@0: void CancelReceiveEvents(); sl@0: void RunL(); sl@0: TInt RunError(TInt aError); sl@0: void DoCancel(); sl@0: void SetDevSoundInfo(CMMFDevSoundSessionXtnd* aDevSound); sl@0: sl@0: private: sl@0: void ConstructL(); sl@0: CMMFDevSoundEventHandler(RMMFAudioPolicyProxy* aAudioPolicyProxy); sl@0: private: sl@0: enum {EGranularity=8}; sl@0: RMMFAudioPolicyProxy* iAudioPolicyProxy; sl@0: TMMFAudioPolicyEventPckg iAudioPolicyEventPckg; sl@0: TRequestStatus iRequestStatus; sl@0: TInt iDevSoundId; sl@0: CMMFDevSoundSessionXtnd* iDevSound; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: #endif