os/mm/mmlibs/mmfw/Effect/inc/mmf/plugin/MmfGlblAudioEffectPlugin.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/Effect/inc/mmf/plugin/MmfGlblAudioEffectPlugin.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,234 @@
     1.4 +
     1.5 +// MmfGlblAudioEffectPlugin.h
     1.6 +
     1.7 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.8 +// All rights reserved.
     1.9 +// This component and the accompanying materials are made available
    1.10 +// under the terms of "Eclipse Public License v1.0"
    1.11 +// which accompanies this distribution, and is available
    1.12 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.13 +//
    1.14 +// Initial Contributors:
    1.15 +// Nokia Corporation - initial contribution.
    1.16 +//
    1.17 +// Contributors:
    1.18 +//
    1.19 +// Description:
    1.20 +//
    1.21 +
    1.22 +#ifndef MMFGLBLAUDIOEFFECTPLUGIN_H
    1.23 +#define MMFGLBLAUDIOEFFECTPLUGIN_H
    1.24 +
    1.25 +#include <mmf/common/mmfglblaudioeffect.h>
    1.26 +
    1.27 +/**
    1.28 +@publishedPartner
    1.29 +@released
    1.30 +@file
    1.31 +*/
    1.32 +
    1.33 +/**
    1.34 +Implementation of CMmfGlobalAudioEffect.
    1.35 +This is the base interface for plugins that provide for global effects. It is intended
    1.36 +to be exclusively called from CMmfGlobalAudioEffect itself.
    1.37 + */
    1.38 + 
    1.39 +class MMmfGlobalAudioImpl
    1.40 +	{
    1.41 +	friend class CMmfGlobalAudioEffect; 
    1.42 +	
    1.43 +public:
    1.44 +	/**
    1.45 +	Release object.
    1.46 +	Equivalent of destructor - called to request data to be deleted.
    1.47 +	*/
    1.48 +	virtual void Release()=0;
    1.49 +
    1.50 +protected:
    1.51 +	/*
    1.52 +	Provide implementation of CMmfGlobalAudioEffect::Capability()
    1.53 +	@param aCurrentOnly
    1.54 +	       If true, capabilities are for current situation only - see text
    1.55 +	@return Capability settings, as given in TCapabilityFlags
    1.56 +	@see CMmfGlobalAudioEffect::Capability()
    1.57 +	*/	
    1.58 +	virtual TUint Capability(TBool aCurrentOnly)=0;
    1.59 +	
    1.60 +	/**
    1.61 +	Provide implementation of CMmfGlobalAudioEffect::RequestNotificationL()
    1.62 +	@param aEventUid
    1.63 +	       Uid specifying event for which notification is requested
    1.64 +	       
    1.65 +	@leave KErrNotSupported
    1.66 +	       If Observer passed during construction was NULL.
    1.67 +	       The Uid is not recognised.
    1.68 +	       The feature is simply not supported in this implementation.
    1.69 +	@see CMmfGlobalAudioEffect::RequestNotificationL()
    1.70 +	*/
    1.71 +	virtual void RequestNotificationL(TUid aEventUid)=0;
    1.72 +	
    1.73 +	/**
    1.74 +	Provide implementation of CMmfGlobalAudioEffect::IsEnabled()
    1.75 +	@return True if SetEnabledL(ETrue), or similar, has been called on this effect
    1.76 +	@see CMmfGlobalAudioEffect::IsEnabled()
    1.77 +	*/
    1.78 +	virtual TBool IsEnabled() const=0;
    1.79 +	
    1.80 +	/**
    1.81 +	Provide implementation of CMmfGlobalAudioEffect::IsActive()
    1.82 +	@return True if the effect is in use
    1.83 +	@see CMmfGlobalAudioEffect::IsActive()
    1.84 +	*/
    1.85 +	virtual TBool IsActive() const=0;
    1.86 +	
    1.87 +	/**
    1.88 +	Provide implementation of CMmfGlobalAudioEffect::SetEnabledL()
    1.89 +	@param aValue
    1.90 +	       If true, enables this specific effect. If false, disables it. 
    1.91 +	@see CMmfGlobalAudioEffect::SetEnabledL()
    1.92 +	*/
    1.93 +	virtual void SetEnabledL(TBool aValue)=0;
    1.94 +	
    1.95 +	/**
    1.96 +	Provide implementation of CMmfGlobalAudioEffect::SettingsByUidL()
    1.97 +	@return The Uid used by SetSettingsByUidL()
    1.98 +	@leave KErrNotSupported
    1.99 +	       The settings cannot be expressed as a Uid (usually means SetSettingsByUidL() was not the last
   1.100 +	       thing to change them).
   1.101 +	@see CMmfGlobalAudioEffect::SettingsByUidL()
   1.102 +	*/
   1.103 +	virtual TUid SettingsByUidL() const=0;
   1.104 +	
   1.105 +	/**
   1.106 +	Provide implementation of CMmfGlobalAudioEffect::SetSettingsByUidL()
   1.107 +	@param aPresetUid
   1.108 +	       Uid representing the preset in question
   1.109 +	@leave KErrNotSupported
   1.110 +	       This implementation does not support presets for this effect
   1.111 +	@leave KErrUnknown
   1.112 +	       The value of aUid does not correspond to a known preset
   1.113 +	@see CMmfGlobalAudioEffect::SetSettingsByUidL()
   1.114 +	*/
   1.115 +	virtual void SetSettingsByUidL(TUid aPresetUid)=0;
   1.116 +	
   1.117 +	/**
   1.118 +	Provide implementation of CMmfGlobalAudioEffect::SettingsByDesL()
   1.119 +	@return HBufC8 containing current settings
   1.120 +	@leave KErrNotSupported
   1.121 +	       This implementation does not support expressing settings in descriptor form
   1.122 +	@see CMmfGlobalAudioEffect::SettingsByDesL()
   1.123 +	*/
   1.124 +	virtual HBufC8* SettingsByDesL() const=0;
   1.125 +	
   1.126 +	/**
   1.127 +	Provide implementation of CMmfGlobalAudioEffect::SetSettingsByDesL()
   1.128 +	@param aParam
   1.129 +	       Descriptor value to use
   1.130 +	@leave KErrNotSupported
   1.131 +	       This implementation does not support expressing settings in descriptor form
   1.132 +	@leave KErrCorrupt
   1.133 +	       Value in descriptor does not correspond to known format
   1.134 +	@see CMmfGlobalAudioEffect::SetSettingsByDesL()	  
   1.135 +	*/
   1.136 +	virtual void SetSettingsByDesL(const TDesC8& aParam)=0;
   1.137 +	
   1.138 +	/**
   1.139 +	Provide implementation of CMmfGlobalAudioEffect::KnownPresetsL()
   1.140 +	@see CMmfGlobalAudioEffect::KnownPresetsL()
   1.141 +	@leave KErrNotSupported
   1.142 +	       This feature may not be supported in some circumstances
   1.143 +	*/
   1.144 +	virtual MMmfGlobalAudioPresetList* KnownPresetsL()=0;
   1.145 +	
   1.146 +	/**
   1.147 +	Provide implementation of CMmfGlobalAudioEffect::ExtractValuesL()
   1.148 +	Extract the settings into a struct
   1.149 +	Note that the implementation should check the size of the supplied package buffer, to check
   1.150 +	it is as expected.
   1.151 +	@param aPackageBuf
   1.152 +	       This should be a package buffer wrapping the appropriate class/struct, and will be 
   1.153 +	       specific to a particular CMmfGlobalAudioEffect derivitive.
   1.154 +	@leave KErrNotSupported
   1.155 +	       This will only be supported by some child classes, and even then will not
   1.156 +	       be supported by all implementations.
   1.157 +	@leave KErrArgument
   1.158 +		   Passed package buffer is not the expected size.
   1.159 +	@see CMmfGlobalAudioEffect::ExtractValuesL()
   1.160 +	*/
   1.161 +	virtual void ExtractValuesL(TDes8& aPackageBuf)=0;
   1.162 +	
   1.163 +	/**
   1.164 +	Provide implementation of CMmfGlobalAudioEffect::SetByValuesL().
   1.165 +	Note that the implementation should check the size of the supplied package buffer, to check
   1.166 +	it is as expected.
   1.167 +	@param aPackageBuf
   1.168 +	       This should be a package buffer wrapping the appropriate class/struct, and will be 
   1.169 +	       specific to a particular CMmfGlobalAudioEffect derivitive.
   1.170 +	@leave KErrNotSupported
   1.171 +	       This will only be supported by some child classes, and even then will not
   1.172 +	       be supported by all implementations.
   1.173 +	@leave KErrArgument
   1.174 +		   Passed package buffer is not the expected size, or individual values are out of range
   1.175 +	@see CMmfGlobalAudioEffect::SetByValuesL()
   1.176 +	*/
   1.177 +	virtual void SetByValuesL(const TDesC8& aPackageBuf)=0;
   1.178 +	
   1.179 +	/**
   1.180 +	Request extension feature.
   1.181 +	This is intended to provide additional features, should a particular global effect
   1.182 +	need it. In typical use, the global effect will make a call to this interface on
   1.183 +	construction. Repeatedly calling this interface will have no additional effect -
   1.184 +	if the interface has already been setup internally, then no further activity will
   1.185 +	take place.
   1.186 +	@param aInterfaceUid
   1.187 +	       Used to indicate which interface is required. 
   1.188 +	@return Standard error code. KErrNotSupported is used to indicate that the particular
   1.189 +	        plugin is used.
   1.190 +	*/
   1.191 +	virtual TInt CreateCustomInterface(TUid aInterfaceUid)=0;
   1.192 +	
   1.193 +	
   1.194 +	/**
   1.195 +	Return previously created extension.
   1.196 +	This returns a custom interface, used to provide additional features for a certain
   1.197 +	global effect. This should only be used if CreateCustomInterface() has already
   1.198 +	been called for the same UID value. This means that any construction for that interface
   1.199 +	has already been called, and thus this call cannot fail. Typically the returned class 
   1.200 +	will be another Mixin.No transfer of ownership is implied. 
   1.201 +
   1.202 +	@param aInterfaceUid
   1.203 +	       Used to indicate which interface is required. 
   1.204 +	@return The requested interface, or NULL if not known.
   1.205 +	@see CreateCustomInterface()
   1.206 +	*/
   1.207 +	virtual TAny* CustomInterface(TUid aInterfaceUid)=0;
   1.208 +	
   1.209 +	
   1.210 +	/**
   1.211 +	Pass destructor key.
   1.212 +	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
   1.213 +	@param aDestructorKey
   1.214 +	       The Uid returned by REComSession::CreateImplementationL() or similar
   1.215 +	*/
   1.216 +	virtual void PassDestructorKey(TUid aDestructorKey)=0;
   1.217 +	
   1.218 +	/**
   1.219 +	Complete construction.
   1.220 +	Pass additional values from the construction phase, used subsequently by the plugin.
   1.221 +	@param aParent
   1.222 +	       The CMmfGlobalAudioEffect that created this object
   1.223 +	@param aObserver
   1.224 +	       Observer as passed to CMmfGlobalAudioEffect::BaseConstructL()
   1.225 +	@see CMmfGlobalAudioEffect::BaseConstructL()
   1.226 +	*/
   1.227 +	virtual void CompleteConstructL(CMmfGlobalAudioEffect* aParent, MMmfGlobalAudioEffectObserver* aObserver)=0;
   1.228 +	
   1.229 +private:
   1.230 +	static MMmfGlobalAudioImpl* NewL(TUid aImplementationUid, 
   1.231 +									 CMmfGlobalAudioEffect* aParent,
   1.232 +	                                 MMmfGlobalAudioEffectObserver* aObserver);
   1.233 +	
   1.234 +	};
   1.235 +
   1.236 +
   1.237 +#endif // MMFGLBLAUDIOEFFECTPLUGIN_