os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/MMFDevSoundCIMuxDeMuxPluginImp.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
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Implementation of aac decoder config custom interface pair
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef AACDECODERCONFIGCI_H
sl@0
    19
#define AACDECODERCONFIGCI_H
sl@0
    20
sl@0
    21
#include <e32base.h>
sl@0
    22
#include <mmf/common/mmfipc.h>
sl@0
    23
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    24
#include <mmf/common/mmfipcserver.h>
sl@0
    25
#endif
sl@0
    26
#include <mmf/server/mmfdevsoundcustominterface.h>
sl@0
    27
#include <mmf/server/mmfdevsoundcustomcommands.h>
sl@0
    28
#include <mmf/server/devsoundstandardcustominterfaces.h>
sl@0
    29
#include <mmf/plugin/mmfdevsoundcustominterface.hrh>
sl@0
    30
#include "devsoundciutestdevices.hrh"
sl@0
    31
sl@0
    32
/**
sl@0
    33
Enum to represent the method called by this custom interface
sl@0
    34
@internalComponent
sl@0
    35
@prototype
sl@0
    36
@file
sl@0
    37
*/
sl@0
    38
enum TMMFDevSoundCIMuxDemuxCommands
sl@0
    39
	{
sl@0
    40
	EMMFDevSoundCIMuxDemuxCauseHeapFail = 0,
sl@0
    41
	EMMFDevSoundCIMuxDemuxStopHeapFail,
sl@0
    42
	EMMFDevSoundCIMuxDemuxCheckHeapFail
sl@0
    43
	};
sl@0
    44
sl@0
    45
class MMMFDevSoundCIMuxPluginInterface
sl@0
    46
	{
sl@0
    47
public:
sl@0
    48
	virtual TInt DevSoundCIMuxCauseHeapFail(TInt aFailCount) =0;
sl@0
    49
	virtual TInt DevSoundCIMuxStopHeapFail() =0;
sl@0
    50
	virtual TInt DevSoundCIMuxCheckHeapFail() =0;
sl@0
    51
	};
sl@0
    52
	
sl@0
    53
sl@0
    54
/**
sl@0
    55
Implementation of the DevSound Interface Mux
sl@0
    56
@internalComponent
sl@0
    57
@prototype
sl@0
    58
@file
sl@0
    59
*/
sl@0
    60
class CMMFDevSoundCIMuxPluginImp : public CBase,
sl@0
    61
								public MMMFDevSoundCustomInterfaceMuxPlugin,
sl@0
    62
								public MMMFDevSoundCIMuxPluginInterface
sl@0
    63
	{
sl@0
    64
public:
sl@0
    65
sl@0
    66
	// from MMMFDevSoundCustomInterfaceMuxPlugin
sl@0
    67
	/**
sl@0
    68
	Attempt to open the interface.
sl@0
    69
	@param  aInterfaceId
sl@0
    70
		    The UID of the interface to open.
sl@0
    71
	@return one of the system wide error codes
sl@0
    72
	*/
sl@0
    73
	virtual TInt OpenInterface(TUid aInterfaceId);
sl@0
    74
sl@0
    75
	/**
sl@0
    76
	Equivalent to destructor.  Called to destroy plugin.
sl@0
    77
	*/
sl@0
    78
	virtual void Release();
sl@0
    79
sl@0
    80
	/**
sl@0
    81
	Pass destructor key.
sl@0
    82
	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
sl@0
    83
	@param aDestructorKey
sl@0
    84
		   The Uid returned by REComSession::CreateImplementationL() or similar
sl@0
    85
	*/
sl@0
    86
	virtual void PassDestructorKey(TUid aDestructorKey);
sl@0
    87
sl@0
    88
	/**
sl@0
    89
	Complete construction.
sl@0
    90
	Pass additional values from the construction phase, used subsequently by the plugin.
sl@0
    91
	@param aCustomUtility
sl@0
    92
		   The custom interface utility used by the plugin to communicate with the remote
sl@0
    93
		   server side DeMux plugin
sl@0
    94
	@leave This method may leave with one of the system-wide error codes.
sl@0
    95
	*/
sl@0
    96
	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
sl@0
    97
sl@0
    98
	/**
sl@0
    99
	Return the custom interface
sl@0
   100
	@param  aInterfaceId
sl@0
   101
		    The UID of the required custom interface
sl@0
   102
	@return the custom interface supported by this plugin
sl@0
   103
	*/
sl@0
   104
	virtual TAny* CustomInterface(TUid aInterfaceId);
sl@0
   105
sl@0
   106
	/**
sl@0
   107
	Instantiate a CI Mux class
sl@0
   108
	@return the pointer to the new class, cast to the Mux plugin mixin
sl@0
   109
	@leave  This method may leave with one of the system-wide error codes.
sl@0
   110
	*/
sl@0
   111
	static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
sl@0
   112
sl@0
   113
	//Specific public method calls for this mux
sl@0
   114
	TInt DevSoundCIMuxStopHeapFail();
sl@0
   115
	TInt DevSoundCIMuxCauseHeapFail(TInt aFailCount);
sl@0
   116
	TInt DevSoundCIMuxCheckHeapFail();
sl@0
   117
	
sl@0
   118
protected:
sl@0
   119
	CMMFDevSoundCIMuxPluginImp();
sl@0
   120
	~CMMFDevSoundCIMuxPluginImp();
sl@0
   121
sl@0
   122
protected:
sl@0
   123
	TUid iKey;
sl@0
   124
	TInt iRemoteHandle;
sl@0
   125
	MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
sl@0
   126
	};
sl@0
   127
sl@0
   128
sl@0
   129
/**
sl@0
   130
Implementation of the DevSound custom interface DeMux
sl@0
   131
@internalComponent
sl@0
   132
@prototype
sl@0
   133
@file
sl@0
   134
*/
sl@0
   135
class CMMFDevSoundCIDemuxPluginImp : public CBase,
sl@0
   136
								  public MMMFDevSoundCustomInterfaceDeMuxPlugin
sl@0
   137
	{
sl@0
   138
public:
sl@0
   139
	/**
sl@0
   140
	Instantiate a CMMFAacDecoderConfigDeMux class
sl@0
   141
	@return a pointer to the new class cast to the DeMux plugin mixin
sl@0
   142
	@leave  This method may leave with one of the system-wide error codes.
sl@0
   143
	*/
sl@0
   144
	static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
sl@0
   145
		
sl@0
   146
	/**
sl@0
   147
	Attempt to open the interface.
sl@0
   148
	@param  aInterfaceId
sl@0
   149
		    The UID of the interface to open.
sl@0
   150
	@return a handle to the remote plugin
sl@0
   151
	*/
sl@0
   152
	virtual TInt OpenInterface(TUid aInterfaceId);
sl@0
   153
sl@0
   154
	/**
sl@0
   155
	Equivalent to destructor.  Called to destroy plugin.
sl@0
   156
	*/
sl@0
   157
	virtual void Release();
sl@0
   158
sl@0
   159
	/**
sl@0
   160
	Pass destructor key.
sl@0
   161
	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
sl@0
   162
	@param aDestructorKey
sl@0
   163
		   The Uid returned by REComSession::CreateImplementationL() or similar
sl@0
   164
	*/
sl@0
   165
	virtual void PassDestructorKey(TUid aDestructorKey);
sl@0
   166
sl@0
   167
	/**
sl@0
   168
	Set the target of the custom interface call
sl@0
   169
	@param aTarget
sl@0
   170
		   The DevSound to call the custom interface on.
sl@0
   171
	*/
sl@0
   172
	virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
sl@0
   173
sl@0
   174
	/**
sl@0
   175
	Complete construction.
sl@0
   176
	@param aUtility
sl@0
   177
		   The DeMux utility to use
sl@0
   178
	@leave This method may leave with one of the system-wide error codes.
sl@0
   179
	*/
sl@0
   180
	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
sl@0
   181
sl@0
   182
	/**
sl@0
   183
	Refresh the current custom interface connections
sl@0
   184
	@leave This method may leave with one of the system-wide error codes.
sl@0
   185
	*/
sl@0
   186
	virtual void RefreshL();
sl@0
   187
sl@0
   188
	// from MMMFDevSoundCustomInterfaceDeMuxPlugin
sl@0
   189
	/**
sl@0
   190
	Open the slave
sl@0
   191
	@param  aInterface
sl@0
   192
		    The UID of the requested interface
sl@0
   193
	@param  aPackageBuf
sl@0
   194
		    A package of data that can be supplied for initialisation
sl@0
   195
	@return the result of the operation
sl@0
   196
	@leave  This method may leave with one of the system-wide error codes.
sl@0
   197
	*/
sl@0
   198
	virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
sl@0
   199
sl@0
   200
	/**
sl@0
   201
	Close the slave
sl@0
   202
	@param aHandle
sl@0
   203
		   The handle of the slave plugin
sl@0
   204
	@leave This method may leave with one of the system-wide error codes.
sl@0
   205
	*/
sl@0
   206
	virtual void DoCloseSlaveL(TInt aHandle);
sl@0
   207
sl@0
   208
	// original RMessage is supplied so that remote DeMux plugin can extract necessary details
sl@0
   209
	// using DeMux utility
sl@0
   210
sl@0
   211
	/**
sl@0
   212
	Relay the synchronous custom command onto the slave
sl@0
   213
	@param  aMessage
sl@0
   214
		    The IPC message to be sent to the slave
sl@0
   215
	@return the result of the operation
sl@0
   216
	@leave  This method may leave with one of the system-wide error codes.
sl@0
   217
	*/
sl@0
   218
	virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
sl@0
   219
sl@0
   220
	/**
sl@0
   221
	Relay the synchronous custom command onto the slave and obtain a result
sl@0
   222
	@param  aMessage
sl@0
   223
		    The IPC message to be sent to the slave
sl@0
   224
	@return the result of the operation
sl@0
   225
	@leave  This method may leave with one of the system-wide error codes.
sl@0
   226
	*/
sl@0
   227
	virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
sl@0
   228
sl@0
   229
	/**
sl@0
   230
	Relay an asynchronous command onto the slave
sl@0
   231
	@param aMessage
sl@0
   232
		   The IPC message to be sent to the slave
sl@0
   233
	@leave This method may leave with one of the system-wide error codes.
sl@0
   234
	*/
sl@0
   235
	virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
sl@0
   236
sl@0
   237
	/**
sl@0
   238
	Relay an asynchronous command onto the slave and obtain a result
sl@0
   239
	@param aMessage
sl@0
   240
		   The IPC message to be sent to the slave@param aMessage
sl@0
   241
	@leave This method may leave with one of the system-wide error codes.
sl@0
   242
	*/
sl@0
   243
	virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
sl@0
   244
sl@0
   245
protected:
sl@0
   246
	//Specific public method calls for this demux
sl@0
   247
	~CMMFDevSoundCIDemuxPluginImp();
sl@0
   248
	CMMFDevSoundCIDemuxPluginImp();
sl@0
   249
sl@0
   250
protected:
sl@0
   251
	MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
sl@0
   252
	MMMFDevSoundCustomInterfaceTarget*		 iTarget;
sl@0
   253
	TUid									 iKey;
sl@0
   254
	};
sl@0
   255
sl@0
   256
#endif