os/mm/devsound/sounddevbt/src/server/MmfBtDevSoundEventHandler.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/sounddevbt/src/server/MmfBtDevSoundEventHandler.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,97 @@
     1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +
    1.20 +#ifndef __MMFBTDEVSOUNDEVENTHANDLER_H
    1.21 +#define __MMFBTDEVSOUNDEVENTHANDLER_H
    1.22 +
    1.23 +#include <e32base.h>
    1.24 +#include <e32std.h>
    1.25 +#include "MmfBtPolicyClientServer.h"
    1.26 +
    1.27 +class CMMFDevSoundSessionXtnd;
    1.28 +
    1.29 +class RMMFAudioPolicyProxy;
    1.30 +
    1.31 +
    1.32 +class TMMFAudioPolicyEvent
    1.33 +	{
    1.34 +public:
    1.35 +/**
    1.36 +	Constructor.
    1.37 +
    1.38 +	@internalTechnology
    1.39 +
    1.40 +	@param "aEventType"	"A code to define the type of event."
    1.41 +	@param "aErrorCode"	"The error code associated with the event."
    1.42 +	@since 7.0s
    1.43 +*/
    1.44 +//	TMMFAudioPolicyEvent(TAudioPolicyEventType aEventType, TInt aErrorCode) : iEventType(aEventType), iErrorCode(aErrorCode) {};
    1.45 +
    1.46 +/**
    1.47 +	Default constructor.
    1.48 +
    1.49 +	Provided so this class can be packaged in a TPckgBuf<>.
    1.50 +	@since 7.0s
    1.51 +*/
    1.52 +	TMMFAudioPolicyEvent() : iEventType(EMMFAudioPolicyNoEvent), iErrorCode(KErrNone) {};
    1.53 +
    1.54 +	enum TAudioPolicyEventType
    1.55 +		{
    1.56 +		EMMFAudioPolicyNoEvent = 0,
    1.57 +		EMMFAudioPolicySwitchToIdle,
    1.58 +		EMMFAudioPolicyPriorityTooLow,
    1.59 +		EMMFAudioPolicyResourceNotification
    1.60 +		};
    1.61 +
    1.62 +	TAudioPolicyEventType iEventType;
    1.63 +	TInt iErrorCode;
    1.64 +	TMMFAudioPolicyState iState;				
    1.65 +
    1.66 +	};
    1.67 +
    1.68 +typedef TPckgBuf<TMMFAudioPolicyEvent> TMMFAudioPolicyEventPckg;
    1.69 +
    1.70 +class CMMFDevSoundEventHandler : public CActive
    1.71 +/**
    1.72 +*@internalTechnology
    1.73 +*/
    1.74 +	{
    1.75 +public:
    1.76 +	static CMMFDevSoundEventHandler* NewL(RMMFAudioPolicyProxy* aAudioPolicyProxy);
    1.77 +	~CMMFDevSoundEventHandler();
    1.78 +	void ReceiveEvents();
    1.79 +	void CancelReceiveEvents();
    1.80 +	void RunL();
    1.81 +	TInt RunError(TInt aError);
    1.82 +	void DoCancel();
    1.83 +	void SetDevSoundInfo(CMMFDevSoundSessionXtnd* aDevSound);
    1.84 +
    1.85 +private:
    1.86 +	void ConstructL();
    1.87 +	CMMFDevSoundEventHandler(RMMFAudioPolicyProxy* aAudioPolicyProxy);
    1.88 +private:
    1.89 +	enum {EGranularity=8};
    1.90 +	RMMFAudioPolicyProxy*  iAudioPolicyProxy;
    1.91 +	TMMFAudioPolicyEventPckg	iAudioPolicyEventPckg;
    1.92 +	TRequestStatus	iRequestStatus;
    1.93 +	TInt			iDevSoundId;
    1.94 +	CMMFDevSoundSessionXtnd*	iDevSound;
    1.95 +	};
    1.96 +
    1.97 +
    1.98 +
    1.99 +
   1.100 +#endif