os/mm/mmlibs/mmfw/Effect/inc/mmf/plugin/MmfGlblAudioEffectPlugin.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
sl@0
     2
// MmfGlblAudioEffectPlugin.h
sl@0
     3
sl@0
     4
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     5
// All rights reserved.
sl@0
     6
// This component and the accompanying materials are made available
sl@0
     7
// under the terms of "Eclipse Public License v1.0"
sl@0
     8
// which accompanies this distribution, and is available
sl@0
     9
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
    10
//
sl@0
    11
// Initial Contributors:
sl@0
    12
// Nokia Corporation - initial contribution.
sl@0
    13
//
sl@0
    14
// Contributors:
sl@0
    15
//
sl@0
    16
// Description:
sl@0
    17
//
sl@0
    18
sl@0
    19
#ifndef MMFGLBLAUDIOEFFECTPLUGIN_H
sl@0
    20
#define MMFGLBLAUDIOEFFECTPLUGIN_H
sl@0
    21
sl@0
    22
#include <mmf/common/mmfglblaudioeffect.h>
sl@0
    23
sl@0
    24
/**
sl@0
    25
@publishedPartner
sl@0
    26
@released
sl@0
    27
@file
sl@0
    28
*/
sl@0
    29
sl@0
    30
/**
sl@0
    31
Implementation of CMmfGlobalAudioEffect.
sl@0
    32
This is the base interface for plugins that provide for global effects. It is intended
sl@0
    33
to be exclusively called from CMmfGlobalAudioEffect itself.
sl@0
    34
 */
sl@0
    35
 
sl@0
    36
class MMmfGlobalAudioImpl
sl@0
    37
	{
sl@0
    38
	friend class CMmfGlobalAudioEffect; 
sl@0
    39
	
sl@0
    40
public:
sl@0
    41
	/**
sl@0
    42
	Release object.
sl@0
    43
	Equivalent of destructor - called to request data to be deleted.
sl@0
    44
	*/
sl@0
    45
	virtual void Release()=0;
sl@0
    46
sl@0
    47
protected:
sl@0
    48
	/*
sl@0
    49
	Provide implementation of CMmfGlobalAudioEffect::Capability()
sl@0
    50
	@param aCurrentOnly
sl@0
    51
	       If true, capabilities are for current situation only - see text
sl@0
    52
	@return Capability settings, as given in TCapabilityFlags
sl@0
    53
	@see CMmfGlobalAudioEffect::Capability()
sl@0
    54
	*/	
sl@0
    55
	virtual TUint Capability(TBool aCurrentOnly)=0;
sl@0
    56
	
sl@0
    57
	/**
sl@0
    58
	Provide implementation of CMmfGlobalAudioEffect::RequestNotificationL()
sl@0
    59
	@param aEventUid
sl@0
    60
	       Uid specifying event for which notification is requested
sl@0
    61
	       
sl@0
    62
	@leave KErrNotSupported
sl@0
    63
	       If Observer passed during construction was NULL.
sl@0
    64
	       The Uid is not recognised.
sl@0
    65
	       The feature is simply not supported in this implementation.
sl@0
    66
	@see CMmfGlobalAudioEffect::RequestNotificationL()
sl@0
    67
	*/
sl@0
    68
	virtual void RequestNotificationL(TUid aEventUid)=0;
sl@0
    69
	
sl@0
    70
	/**
sl@0
    71
	Provide implementation of CMmfGlobalAudioEffect::IsEnabled()
sl@0
    72
	@return True if SetEnabledL(ETrue), or similar, has been called on this effect
sl@0
    73
	@see CMmfGlobalAudioEffect::IsEnabled()
sl@0
    74
	*/
sl@0
    75
	virtual TBool IsEnabled() const=0;
sl@0
    76
	
sl@0
    77
	/**
sl@0
    78
	Provide implementation of CMmfGlobalAudioEffect::IsActive()
sl@0
    79
	@return True if the effect is in use
sl@0
    80
	@see CMmfGlobalAudioEffect::IsActive()
sl@0
    81
	*/
sl@0
    82
	virtual TBool IsActive() const=0;
sl@0
    83
	
sl@0
    84
	/**
sl@0
    85
	Provide implementation of CMmfGlobalAudioEffect::SetEnabledL()
sl@0
    86
	@param aValue
sl@0
    87
	       If true, enables this specific effect. If false, disables it. 
sl@0
    88
	@see CMmfGlobalAudioEffect::SetEnabledL()
sl@0
    89
	*/
sl@0
    90
	virtual void SetEnabledL(TBool aValue)=0;
sl@0
    91
	
sl@0
    92
	/**
sl@0
    93
	Provide implementation of CMmfGlobalAudioEffect::SettingsByUidL()
sl@0
    94
	@return The Uid used by SetSettingsByUidL()
sl@0
    95
	@leave KErrNotSupported
sl@0
    96
	       The settings cannot be expressed as a Uid (usually means SetSettingsByUidL() was not the last
sl@0
    97
	       thing to change them).
sl@0
    98
	@see CMmfGlobalAudioEffect::SettingsByUidL()
sl@0
    99
	*/
sl@0
   100
	virtual TUid SettingsByUidL() const=0;
sl@0
   101
	
sl@0
   102
	/**
sl@0
   103
	Provide implementation of CMmfGlobalAudioEffect::SetSettingsByUidL()
sl@0
   104
	@param aPresetUid
sl@0
   105
	       Uid representing the preset in question
sl@0
   106
	@leave KErrNotSupported
sl@0
   107
	       This implementation does not support presets for this effect
sl@0
   108
	@leave KErrUnknown
sl@0
   109
	       The value of aUid does not correspond to a known preset
sl@0
   110
	@see CMmfGlobalAudioEffect::SetSettingsByUidL()
sl@0
   111
	*/
sl@0
   112
	virtual void SetSettingsByUidL(TUid aPresetUid)=0;
sl@0
   113
	
sl@0
   114
	/**
sl@0
   115
	Provide implementation of CMmfGlobalAudioEffect::SettingsByDesL()
sl@0
   116
	@return HBufC8 containing current settings
sl@0
   117
	@leave KErrNotSupported
sl@0
   118
	       This implementation does not support expressing settings in descriptor form
sl@0
   119
	@see CMmfGlobalAudioEffect::SettingsByDesL()
sl@0
   120
	*/
sl@0
   121
	virtual HBufC8* SettingsByDesL() const=0;
sl@0
   122
	
sl@0
   123
	/**
sl@0
   124
	Provide implementation of CMmfGlobalAudioEffect::SetSettingsByDesL()
sl@0
   125
	@param aParam
sl@0
   126
	       Descriptor value to use
sl@0
   127
	@leave KErrNotSupported
sl@0
   128
	       This implementation does not support expressing settings in descriptor form
sl@0
   129
	@leave KErrCorrupt
sl@0
   130
	       Value in descriptor does not correspond to known format
sl@0
   131
	@see CMmfGlobalAudioEffect::SetSettingsByDesL()	  
sl@0
   132
	*/
sl@0
   133
	virtual void SetSettingsByDesL(const TDesC8& aParam)=0;
sl@0
   134
	
sl@0
   135
	/**
sl@0
   136
	Provide implementation of CMmfGlobalAudioEffect::KnownPresetsL()
sl@0
   137
	@see CMmfGlobalAudioEffect::KnownPresetsL()
sl@0
   138
	@leave KErrNotSupported
sl@0
   139
	       This feature may not be supported in some circumstances
sl@0
   140
	*/
sl@0
   141
	virtual MMmfGlobalAudioPresetList* KnownPresetsL()=0;
sl@0
   142
	
sl@0
   143
	/**
sl@0
   144
	Provide implementation of CMmfGlobalAudioEffect::ExtractValuesL()
sl@0
   145
	Extract the settings into a struct
sl@0
   146
	Note that the implementation should check the size of the supplied package buffer, to check
sl@0
   147
	it is as expected.
sl@0
   148
	@param aPackageBuf
sl@0
   149
	       This should be a package buffer wrapping the appropriate class/struct, and will be 
sl@0
   150
	       specific to a particular CMmfGlobalAudioEffect derivitive.
sl@0
   151
	@leave KErrNotSupported
sl@0
   152
	       This will only be supported by some child classes, and even then will not
sl@0
   153
	       be supported by all implementations.
sl@0
   154
	@leave KErrArgument
sl@0
   155
		   Passed package buffer is not the expected size.
sl@0
   156
	@see CMmfGlobalAudioEffect::ExtractValuesL()
sl@0
   157
	*/
sl@0
   158
	virtual void ExtractValuesL(TDes8& aPackageBuf)=0;
sl@0
   159
	
sl@0
   160
	/**
sl@0
   161
	Provide implementation of CMmfGlobalAudioEffect::SetByValuesL().
sl@0
   162
	Note that the implementation should check the size of the supplied package buffer, to check
sl@0
   163
	it is as expected.
sl@0
   164
	@param aPackageBuf
sl@0
   165
	       This should be a package buffer wrapping the appropriate class/struct, and will be 
sl@0
   166
	       specific to a particular CMmfGlobalAudioEffect derivitive.
sl@0
   167
	@leave KErrNotSupported
sl@0
   168
	       This will only be supported by some child classes, and even then will not
sl@0
   169
	       be supported by all implementations.
sl@0
   170
	@leave KErrArgument
sl@0
   171
		   Passed package buffer is not the expected size, or individual values are out of range
sl@0
   172
	@see CMmfGlobalAudioEffect::SetByValuesL()
sl@0
   173
	*/
sl@0
   174
	virtual void SetByValuesL(const TDesC8& aPackageBuf)=0;
sl@0
   175
	
sl@0
   176
	/**
sl@0
   177
	Request extension feature.
sl@0
   178
	This is intended to provide additional features, should a particular global effect
sl@0
   179
	need it. In typical use, the global effect will make a call to this interface on
sl@0
   180
	construction. Repeatedly calling this interface will have no additional effect -
sl@0
   181
	if the interface has already been setup internally, then no further activity will
sl@0
   182
	take place.
sl@0
   183
	@param aInterfaceUid
sl@0
   184
	       Used to indicate which interface is required. 
sl@0
   185
	@return Standard error code. KErrNotSupported is used to indicate that the particular
sl@0
   186
	        plugin is used.
sl@0
   187
	*/
sl@0
   188
	virtual TInt CreateCustomInterface(TUid aInterfaceUid)=0;
sl@0
   189
	
sl@0
   190
	
sl@0
   191
	/**
sl@0
   192
	Return previously created extension.
sl@0
   193
	This returns a custom interface, used to provide additional features for a certain
sl@0
   194
	global effect. This should only be used if CreateCustomInterface() has already
sl@0
   195
	been called for the same UID value. This means that any construction for that interface
sl@0
   196
	has already been called, and thus this call cannot fail. Typically the returned class 
sl@0
   197
	will be another Mixin.No transfer of ownership is implied. 
sl@0
   198
sl@0
   199
	@param aInterfaceUid
sl@0
   200
	       Used to indicate which interface is required. 
sl@0
   201
	@return The requested interface, or NULL if not known.
sl@0
   202
	@see CreateCustomInterface()
sl@0
   203
	*/
sl@0
   204
	virtual TAny* CustomInterface(TUid aInterfaceUid)=0;
sl@0
   205
	
sl@0
   206
	
sl@0
   207
	/**
sl@0
   208
	Pass destructor key.
sl@0
   209
	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
sl@0
   210
	@param aDestructorKey
sl@0
   211
	       The Uid returned by REComSession::CreateImplementationL() or similar
sl@0
   212
	*/
sl@0
   213
	virtual void PassDestructorKey(TUid aDestructorKey)=0;
sl@0
   214
	
sl@0
   215
	/**
sl@0
   216
	Complete construction.
sl@0
   217
	Pass additional values from the construction phase, used subsequently by the plugin.
sl@0
   218
	@param aParent
sl@0
   219
	       The CMmfGlobalAudioEffect that created this object
sl@0
   220
	@param aObserver
sl@0
   221
	       Observer as passed to CMmfGlobalAudioEffect::BaseConstructL()
sl@0
   222
	@see CMmfGlobalAudioEffect::BaseConstructL()
sl@0
   223
	*/
sl@0
   224
	virtual void CompleteConstructL(CMmfGlobalAudioEffect* aParent, MMmfGlobalAudioEffectObserver* aObserver)=0;
sl@0
   225
	
sl@0
   226
private:
sl@0
   227
	static MMmfGlobalAudioImpl* NewL(TUid aImplementationUid, 
sl@0
   228
									 CMmfGlobalAudioEffect* aParent,
sl@0
   229
	                                 MMmfGlobalAudioEffectObserver* aObserver);
sl@0
   230
	
sl@0
   231
	};
sl@0
   232
sl@0
   233
sl@0
   234
#endif // MMFGLBLAUDIOEFFECTPLUGIN_