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: #ifndef __MMFBTAUDIOPOLICYSERVER_H__ sl@0: #define __MMFBTAUDIOPOLICYSERVER_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include "MmfBtAudioPolicy.h" sl@0: #include "MmfBtPolicyClientServer.h" sl@0: sl@0: class CMMFAudioPolicyServer; // declared here. sl@0: sl@0: NONSHARABLE_CLASS( CMMFAudioPolicyServer ): public CMmfIpcServer sl@0: /** sl@0: *@internalTechnology sl@0: */ sl@0: { sl@0: public: sl@0: static CMMFAudioPolicyServer* NewL(); sl@0: ~CMMFAudioPolicyServer(); sl@0: CMmfIpcSession* NewSessionL(const TVersion &aVersion) const; sl@0: void IncrementSessionId(); sl@0: void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched, TMMFAudioPolicyEvent& aEvent); sl@0: void LaunchRequest(TInt aSessionId, TMMFAudioPolicyEvent& aEvent); sl@0: CAudioPolicy* AudioPolicy() {return iAudioPolicy;}; sl@0: TInt PolicySessionId() {return iPolicySessionId;}; sl@0: static TInt SendNotification(TAny* aAny); sl@0: TBool IsTimerActive() const; sl@0: sl@0: IMPORT_C static TInt StartThread(TAny* aParams); sl@0: void IncrementSessionCount(); sl@0: void DecrementSessionCount(); sl@0: TInt PolicySessionCount(); sl@0: sl@0: void StopNotificationTimer(); sl@0: void StartNotificationTimer(); sl@0: sl@0: private: sl@0: class CNotificationTimer : public CTimer sl@0: { sl@0: public: sl@0: static CNotificationTimer* NewL(TCallBack aCallBack); sl@0: private: sl@0: virtual void RunL(); sl@0: CNotificationTimer(TCallBack aCallBack); sl@0: private: sl@0: TCallBack iCallBack; sl@0: }; sl@0: sl@0: CMMFAudioPolicyServer(); sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: TInt iPolicySessionId; sl@0: TInt iSessionToBeLaunched; sl@0: CAudioPolicy* iAudioPolicy; sl@0: TInt iPolicySessionCount; sl@0: CNotificationTimer* iNotificationTimer; sl@0: }; sl@0: sl@0: #endif