sl@0: /*
sl@0: * Copyright (c) 2004 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:  This is the definition of the Loudness proxy class.
sl@0: *
sl@0: *
sl@0: */
sl@0: 
sl@0: 
sl@0: #ifndef CLOUDNESSPROXY_H
sl@0: #define CLOUDNESSPROXY_H
sl@0: 
sl@0: // INCLUDES
sl@0: 
sl@0: #include <e32base.h>
sl@0: #include <LoudnessBase.h>
sl@0: #include <mmf/common/mmfcontrollerframework.h>
sl@0: #include <CustomCommandUtility.h>
sl@0: #include "LoudnessMessageTypes.h"
sl@0: #include <MLoudnessObserver.h>
sl@0: 
sl@0: // FORWARD DECLARATION
sl@0: class CLoudnessEventObserver;
sl@0: 
sl@0: // CLASS DECLARATION
sl@0: 
sl@0: /**
sl@0: *  Interface class to be implemented by objects that receives callbacks from Loudness Event Observer.
sl@0: *
sl@0: *  @since 3.0
sl@0: */
sl@0: class MLoudnessCallback
sl@0:     {
sl@0:     public:
sl@0: 
sl@0:         /**
sl@0:         * Invoked by the Loudness Event Observer when the Loudness object changes state
sl@0:         * @since 3.0
sl@0:         * @param aBuffer Buffer containing the Loudness data
sl@0:         */
sl@0:         virtual void LoudnessEvent( const TDesC8& aDataPckg ) = 0;
sl@0: 
sl@0:     };
sl@0: 
sl@0: /**
sl@0: *  This is the Loudness effect proxy class responsible for handling framework messages.
sl@0: *
sl@0: *  @lib LoudnessProxy.lib
sl@0: *  @since 3.0
sl@0: */
sl@0: 
sl@0: class CLoudnessProxy : public CLoudness,
sl@0: 					         public MLoudnessCallback
sl@0: 	{
sl@0: 	public:		// Constructors and destructor
sl@0: 
sl@0: 	    /**
sl@0:         *
sl@0:         * Factory function for creating the Loudness proxy object.
sl@0:         * @since 3.0
sl@0:         * @param aMessageHandler reference to message handler
sl@0:         * @param aCustomCommand reference to custom command utility
sl@0:         * @return	pointer to a Loudness proxy object
sl@0:         */
sl@0: 		IMPORT_C static CLoudnessProxy* NewL( TMMFMessageDestinationPckg aMessageHandler,
sl@0:                      						        MCustomCommand& aCustomCommand,
sl@0:                       						        CCustomInterfaceUtility* aCustomInterfaceUtility );
sl@0: 		/**
sl@0:         *
sl@0:         * Destructor
sl@0:         */
sl@0: 		virtual ~CLoudnessProxy();
sl@0: 
sl@0: 	public: // functions from base class
sl@0: 
sl@0: 		/**
sl@0: 		* From CAudioEffect
sl@0:         * Apply effect settings
sl@0:         * @since 3.0
sl@0:         */
sl@0: 		IMPORT_C virtual void ApplyL();
sl@0: 
sl@0: 	public: // functions from MLoudnessCallback
sl@0: 
sl@0: 		/**
sl@0: 		* From MLoudnessCallback
sl@0:         * Changes to Loudness data has occured
sl@0:         * @since 3.0
sl@0:         * @param aBuffer Buffer containing serialized Loudness data
sl@0:         */
sl@0: 		void LoudnessEvent( const TDesC8& aDataPckg );
sl@0: 
sl@0: 	private:
sl@0: 
sl@0: 		/**
sl@0: 		* Private C++ constructor for this class.
sl@0:         * @since	3.0
sl@0:         * @param aMessageHandler reference to message handler
sl@0:         * @param aCustomCommand reference to custom command utility
sl@0:         * @return	-
sl@0:         */
sl@0: 		CLoudnessProxy(TMMFMessageDestinationPckg aMessageHandler, MCustomCommand& aCustomCommand,
sl@0: 					         CCustomInterfaceUtility* aCustomInterfaceUtility);
sl@0: 
sl@0: 		/**
sl@0: 		* Second phase constructor for this class.
sl@0:         * @since	3.0
sl@0:         * @return -
sl@0:         */
sl@0: 		void ConstructL();
sl@0: 
sl@0: 		/**
sl@0: 		* Start the active observer.
sl@0:         * @since	3.0
sl@0: 		* @param -
sl@0:         * @return -
sl@0:         */
sl@0:         void StartObserver();
sl@0: 
sl@0: 	private:
sl@0: 
sl@0: 		// Pointer to custom command utility
sl@0: 		MCustomCommand* iCustomCommand;
sl@0: 		// Message handler handle
sl@0: 		TMMFMessageDestinationPckg iMessageHandler;
sl@0: 	 	// Loudness Event Observer
sl@0: 		CLoudnessEventObserver* iLoudnessEventObserver;
sl@0: 		// Pointer to the custom interface utility
sl@0:     	CCustomInterfaceUtility* iCustomInterfaceUtility;
sl@0: 
sl@0: 
sl@0: 
sl@0: 	};
sl@0: 
sl@0: #endif	// of CLOUDNESSPROXY_H
sl@0: 
sl@0: // End of File