First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __MMFBTAUDIOPOLICYSERVER_H__
17 #define __MMFBTAUDIOPOLICYSERVER_H__
21 #include "MmfBtAudioPolicy.h"
22 #include "MmfBtPolicyClientServer.h"
24 class CMMFAudioPolicyServer; // declared here.
26 NONSHARABLE_CLASS( CMMFAudioPolicyServer ): public CMmfIpcServer
32 static CMMFAudioPolicyServer* NewL();
33 ~CMMFAudioPolicyServer();
34 CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
35 void IncrementSessionId();
36 void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched, TMMFAudioPolicyEvent& aEvent);
37 void LaunchRequest(TInt aSessionId, TMMFAudioPolicyEvent& aEvent);
38 CAudioPolicy* AudioPolicy() {return iAudioPolicy;};
39 TInt PolicySessionId() {return iPolicySessionId;};
40 static TInt SendNotification(TAny* aAny);
41 TBool IsTimerActive() const;
43 IMPORT_C static TInt StartThread(TAny* aParams);
44 void IncrementSessionCount();
45 void DecrementSessionCount();
46 TInt PolicySessionCount();
48 void StopNotificationTimer();
49 void StartNotificationTimer();
52 class CNotificationTimer : public CTimer
55 static CNotificationTimer* NewL(TCallBack aCallBack);
58 CNotificationTimer(TCallBack aCallBack);
63 CMMFAudioPolicyServer();
67 TInt iPolicySessionId;
68 TInt iSessionToBeLaunched;
69 CAudioPolicy* iAudioPolicy;
70 TInt iPolicySessionCount;
71 CNotificationTimer* iNotificationTimer;