1 // Copyright (c) 2008-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.
24 #ifndef REMCONABSOLUTEVOLUMEAPITARGET_H
25 #define REMCONABSOLUTEVOLUMEAPITARGET_H
27 #include <remcon/remconinterfacebase.h>
28 #include <remcon/remconinterfaceif.h>
30 _LIT(KAbsoluteVolumeTargetPanicName, "AbsoluteVolumeTarget");
31 enum TAbsoluteVolumeTargetPanics
33 ETargetInvalidMaxVolume = 0,
34 ETargetVolumeBeyondMaxVolume = 1,
37 class MRemConAbsoluteVolumeTargetObserver;
40 Client-instantiable type supporting sending absolute volume API responses for
41 Set Absolute Volume and Register Absolute Volume Change Notification. This API
42 should be used in preference to the extapi.
44 NONSHARABLE_CLASS(CRemConAbsoluteVolumeTarget) : public CRemConInterfaceBase,
45 public MRemConInterfaceIf2
48 IMPORT_C static CRemConAbsoluteVolumeTarget* NewL(
49 CRemConInterfaceSelector& aInterfaceSelector,
50 MRemConAbsoluteVolumeTargetObserver& aObserver,
54 IMPORT_C ~CRemConAbsoluteVolumeTarget();
57 IMPORT_C void SetAbsoluteVolumeResponse(TUint32 aVolume,
60 IMPORT_C void AbsoluteVolumeChanged(TUint32 aVolume);
63 CRemConAbsoluteVolumeTarget(CRemConInterfaceSelector& aInterfaceSelector,
64 MRemConAbsoluteVolumeTargetObserver& aObserver,
70 private: // From CRemConInterfaceBase
71 TAny* GetInterfaceIf(TUid aUid);
73 private: // From MRemConInterfaceIf2
74 void MrcibNewMessage(TUint aOperationId,
76 TRemConMessageSubType aMsgSubType);
78 private: // Utility Funtions
79 void SendError(TInt aError, TUint aOperationId);
80 void SendNotificationResponse(TRemConMessageSubType aMsgSubType);
81 void ProcessGetStatus();
82 void ProcessGetStatusAndBeginObserving();
83 void ProcessSetAbsoluteVolume(const TDesC8& aData);
86 MRemConAbsoluteVolumeTargetObserver& iObserver;
89 // ETrue indicates a request for absolute volume change notification has
91 TBool iAbsoluteVolumeNotificationRequest;
93 TUint32 iClientVolume;
94 TUint32 iClientMaxVolume;
96 #endif // ABSOLUTEVOLUMEAPITARGET_H