Update contrib.
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 __MMFAUDIOPOLICYSERVER_H__
17 #define __MMFAUDIOPOLICYSERVER_H__
21 #include "MmfAudioPolicy.h"
22 #include "MmfPolicyClientServer.h"
23 #include "MmfAudioPolicyStart.h"
25 class CMMFAudioPolicyServer; // declared here.
27 NONSHARABLE_CLASS( CMMFAudioPolicyServer ): public CMmfIpcServer
33 static CMMFAudioPolicyServer* NewL();
34 ~CMMFAudioPolicyServer();
35 CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
36 void IncrementSessionId();
37 void SendEventToClient(TInt aSessionToAlert,const TMMFAudioPolicyEvent& aEvent);
38 void LaunchRequest(TInt aSessionId,const TMMFAudioPolicyEvent& aEvent);
39 inline CAudioPolicy* AudioPolicy() {return iAudioPolicy;};
40 inline TInt PolicySessionId() {return iPolicySessionId;};
41 static TInt SendNotification(TAny* aAny);
42 TBool IsTimerActive() const;
44 IMPORT_C static TInt StartThread(TAny* aParams);
45 void IncrementSessionCount();
46 void DecrementSessionCount();
47 TInt PolicySessionCount();
49 void StopNotificationTimer();
50 void StartNotificationTimer(TBool aZeroDelay=EFalse);
53 class CNotificationTimer : public CTimer
56 static CNotificationTimer* NewL(TCallBack aCallBack);
59 CNotificationTimer(TCallBack aCallBack);
64 CMMFAudioPolicyServer();
66 static void StartThreadL(TServerStart& aStart);
69 TInt iPolicySessionId;
70 CAudioPolicy* iAudioPolicy;
71 TInt iPolicySessionCount;
72 CNotificationTimer* iNotificationTimer;