devsound/devsoundrefplugin/src/server/MmfDevSoundEventHandler.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #ifndef __MMFDEVSOUNDEVENTHANDLER_H
       
    18 #define __MMFDEVSOUNDEVENTHANDLER_H
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <e32std.h>
       
    22 #include "MmfPolicyClientServer.h"
       
    23 
       
    24 class CMMFDevSoundSessionXtnd;
       
    25 
       
    26 class RMMFAudioPolicyProxy;
       
    27 
       
    28 
       
    29 class TMMFAudioPolicyEvent
       
    30 	{
       
    31 public:
       
    32 
       
    33 /**
       
    34 	Default constructor.
       
    35 
       
    36 	Provided so this class can be packaged in a TPckgBuf<>.
       
    37 	@since 7.0s
       
    38 */
       
    39 	TMMFAudioPolicyEvent() : iEventType(EMMFAudioPolicyNoEvent), iErrorCode(KErrNone) {};
       
    40 	
       
    41 	enum TAudioPolicyEventType
       
    42 		{
       
    43 		EMMFAudioPolicyNoEvent = 0,
       
    44 		EMMFAudioPolicySwitchToIdle,
       
    45 		EMMFAudioPolicyPriorityTooLow,
       
    46 		EMMFAudioPolicyResourceNotification
       
    47 		};
       
    48 		
       
    49 	TMMFAudioPolicyEvent(TAudioPolicyEventType aType, TInt aError, TMMFAudioPolicyState aState) : 
       
    50 							iEventType(aType), iErrorCode(aError), iState(aState) {};
       
    51 
       
    52 	TAudioPolicyEventType iEventType;
       
    53 	TInt iErrorCode;
       
    54 	TMMFAudioPolicyState iState;				
       
    55 
       
    56 	};
       
    57 
       
    58 typedef TPckgBuf<TMMFAudioPolicyEvent> TMMFAudioPolicyEventPckg;
       
    59 
       
    60 class CMMFDevSoundEventHandler : public CActive
       
    61 /**
       
    62 *@internalTechnology
       
    63 */
       
    64 	{
       
    65 public:
       
    66 	static CMMFDevSoundEventHandler* NewL(RMMFAudioPolicyProxy* aAudioPolicyProxy);
       
    67 	~CMMFDevSoundEventHandler();
       
    68 	void ReceiveEvents();
       
    69 	void CancelReceiveEvents();
       
    70 	void RunL();
       
    71 	TInt RunError(TInt aError);
       
    72 	void DoCancel();
       
    73 	void SetDevSoundInfo(CMMFDevSoundSessionXtnd* aDevSound);
       
    74 
       
    75 private:
       
    76 	void ConstructL();
       
    77 	CMMFDevSoundEventHandler(RMMFAudioPolicyProxy* aAudioPolicyProxy);
       
    78 private:
       
    79 	enum {EGranularity=8};
       
    80 	RMMFAudioPolicyProxy*  iAudioPolicyProxy;
       
    81 	TMMFAudioPolicyEventPckg	iAudioPolicyEventPckg;
       
    82 	TRequestStatus	iRequestStatus;
       
    83 	TInt			iDevSoundId;
       
    84 	CMMFDevSoundSessionXtnd*	iDevSound;
       
    85 	};
       
    86 
       
    87 
       
    88 
       
    89 
       
    90 #endif