epoc32/include/mw/absolutevolumeapitarget.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/absolutevolumeapitarget.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,96 @@
     1.4 +// Copyright (c) 2008-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 +
    1.21 +/**
    1.22 + @file
    1.23 + @publishedAll
    1.24 + @released
    1.25 +*/
    1.26 +
    1.27 +#ifndef REMCONABSOLUTEVOLUMEAPITARGET_H
    1.28 +#define REMCONABSOLUTEVOLUMEAPITARGET_H
    1.29 +
    1.30 +#include <remcon/remconinterfacebase.h>
    1.31 +#include <remcon/remconinterfaceif.h>
    1.32 +
    1.33 +_LIT(KAbsoluteVolumeTargetPanicName, "AbsoluteVolumeTarget");
    1.34 +enum TAbsoluteVolumeTargetPanics
    1.35 +    {
    1.36 +    ETargetInvalidMaxVolume = 0,
    1.37 +    ETargetVolumeBeyondMaxVolume = 1,
    1.38 +    };
    1.39 +
    1.40 +class MRemConAbsoluteVolumeTargetObserver;
    1.41 +
    1.42 +/**
    1.43 +Client-instantiable type supporting sending absolute volume API responses for
    1.44 +Set Absolute Volume and Register Absolute Volume Change Notification. This API
    1.45 +should be used in preference to the extapi.
    1.46 +*/
    1.47 +NONSHARABLE_CLASS(CRemConAbsoluteVolumeTarget) : public CRemConInterfaceBase,
    1.48 +                                                 public MRemConInterfaceIf2
    1.49 +	{
    1.50 +public:
    1.51 +	IMPORT_C static CRemConAbsoluteVolumeTarget* NewL(
    1.52 +			CRemConInterfaceSelector& aInterfaceSelector, 
    1.53 +			MRemConAbsoluteVolumeTargetObserver& aObserver,
    1.54 +			TUint32 aVolume, 
    1.55 +			TUint32 aMaxVolume);
    1.56 +	
    1.57 +	IMPORT_C ~CRemConAbsoluteVolumeTarget();
    1.58 +
    1.59 +public:
    1.60 +	IMPORT_C void SetAbsoluteVolumeResponse(TUint32 aVolume, 
    1.61 +			TInt aErr);
    1.62 +	
    1.63 +	IMPORT_C void AbsoluteVolumeChanged(TUint32 aVolume);
    1.64 +	
    1.65 +private:
    1.66 +    CRemConAbsoluteVolumeTarget(CRemConInterfaceSelector& aInterfaceSelector,
    1.67 +    		MRemConAbsoluteVolumeTargetObserver& aObserver,
    1.68 +    		TUint32 aVolume, 
    1.69 +    		TUint32 aMaxVolume);
    1.70 +
    1.71 +	void ConstructL();
    1.72 +
    1.73 +private: // From CRemConInterfaceBase
    1.74 +	TAny* GetInterfaceIf(TUid aUid);
    1.75 +
    1.76 +private: // From MRemConInterfaceIf2
    1.77 +	void MrcibNewMessage(TUint aOperationId, 
    1.78 +			const TDesC8& aData, 
    1.79 +			TRemConMessageSubType aMsgSubType);
    1.80 +
    1.81 +private: // Utility Funtions
    1.82 +	void SendError(TInt aError, TUint aOperationId);
    1.83 +	void SendNotificationResponse(TRemConMessageSubType aMsgSubType);
    1.84 +	void ProcessGetStatus();
    1.85 +	void ProcessGetStatusAndBeginObserving();
    1.86 +	void ProcessSetAbsoluteVolume(const TDesC8& aData);
    1.87 +
    1.88 +private: // Unowned
    1.89 +    MRemConAbsoluteVolumeTargetObserver& iObserver;
    1.90 +
    1.91 +private: // Owned
    1.92 +	// ETrue indicates a request for absolute volume change notification has 
    1.93 +	// been received.
    1.94 +	TBool                     iAbsoluteVolumeNotificationRequest;
    1.95 +	RBuf8                     iOutBuf;
    1.96 +	TUint32                   iClientVolume;
    1.97 +	TUint32                   iClientMaxVolume;
    1.98 +	};
    1.99 +#endif // ABSOLUTEVOLUMEAPITARGET_H