os/mm/devsound/devsoundpluginsupport/src/CustomInterfaces/underflowautostopcontrolci.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-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 Underflow auto stop control custom interface pair
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef UNDERFLOWAUTOSTOPCONTROLCI_H
sl@0
    19
#define UNDERFLOWAUTOSTOPCONTROLCI_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
sl@0
    31
/**
sl@0
    32
Enum to represent the method called by this custom interface
sl@0
    33
@internalComponent
sl@0
    34
@prototype
sl@0
    35
@file
sl@0
    36
*/
sl@0
    37
enum TMMFDevSoundCIUnderflowAutoStopControlCommands
sl@0
    38
	{
sl@0
    39
	EMMFDevSoundCIUnderflowAutoStopCtrlTurnOffUnderflowAutoStop
sl@0
    40
	};
sl@0
    41
sl@0
    42
/**
sl@0
    43
Implementation of the Underflow auto stop control custom interface Mux
sl@0
    44
@internalComponent
sl@0
    45
@prototype
sl@0
    46
@file
sl@0
    47
*/
sl@0
    48
class CMMFUnderflowAutoStopControlMux : public CBase,
sl@0
    49
										public MMMFDevSoundCustomInterfaceMuxPlugin,
sl@0
    50
										public MMMFUnderflowAutoStopControl
sl@0
    51
	{
sl@0
    52
public:
sl@0
    53
sl@0
    54
	// from MMMFDevSoundCustomInterfaceMuxPlugin
sl@0
    55
	/**
sl@0
    56
	Attempt to open the interface.
sl@0
    57
	@param  aInterfaceId
sl@0
    58
		    The UID of the interface to open.
sl@0
    59
	@return one of the system wide error codes
sl@0
    60
	*/
sl@0
    61
	virtual TInt OpenInterface(TUid aInterfaceId);
sl@0
    62
sl@0
    63
	/**
sl@0
    64
	Equivalent to destructor.  Called to destroy plugin.
sl@0
    65
	*/
sl@0
    66
	virtual void Release();
sl@0
    67
sl@0
    68
	/**
sl@0
    69
	Pass destructor key.
sl@0
    70
	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
sl@0
    71
	@param aDestructorKey
sl@0
    72
		   The Uid returned by REComSession::CreateImplementationL() or similar
sl@0
    73
	*/
sl@0
    74
	virtual void PassDestructorKey(TUid aDestructorKey);
sl@0
    75
sl@0
    76
	/**
sl@0
    77
	Complete construction.
sl@0
    78
	Pass additional values from the construction phase, used subsequently by the plugin.
sl@0
    79
	@param aCustomUtility
sl@0
    80
		   The custom interface utility used by the plugin to communicate with the remote
sl@0
    81
		   server side DeMux plugin
sl@0
    82
	@leave This method may leave with one of the system-wide error codes.
sl@0
    83
	*/
sl@0
    84
	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
sl@0
    85
sl@0
    86
	/**
sl@0
    87
	Return the custom interface
sl@0
    88
	@param  aInterfaceId
sl@0
    89
		    The UID of the required custom interface
sl@0
    90
	@return the custom interface supported by this plugin
sl@0
    91
	*/
sl@0
    92
	virtual TAny* CustomInterface(TUid aInterfaceId);
sl@0
    93
sl@0
    94
	/**
sl@0
    95
	Instantiate a CI Mux class
sl@0
    96
	@return the pointer to the new class, cast to the Mux plugin mixin
sl@0
    97
	@leave  This method may leave with one of the system-wide error codes.
sl@0
    98
	*/
sl@0
    99
	static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
sl@0
   100
sl@0
   101
	// from MMMFUnderflowAutoStopControl
sl@0
   102
	//@see MMMFUnderflowAutoStopControl
sl@0
   103
	virtual TInt MmuascTurnOffUnderflowAutoStop();
sl@0
   104
sl@0
   105
protected:
sl@0
   106
	CMMFUnderflowAutoStopControlMux();
sl@0
   107
	~CMMFUnderflowAutoStopControlMux();
sl@0
   108
sl@0
   109
protected:
sl@0
   110
	TUid iKey;
sl@0
   111
	TInt iRemoteHandle;
sl@0
   112
	MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
sl@0
   113
	};
sl@0
   114
sl@0
   115
sl@0
   116
/**
sl@0
   117
Implementation of the Underflow auto stop control custom interface DeMux
sl@0
   118
@internalComponent
sl@0
   119
@prototype
sl@0
   120
@file
sl@0
   121
*/
sl@0
   122
class CMMFUnderflowAutoStopControlDeMux : public CBase,
sl@0
   123
										  public MMMFDevSoundCustomInterfaceDeMuxPlugin
sl@0
   124
	{
sl@0
   125
public:
sl@0
   126
	/**
sl@0
   127
	Instantiate a CMMFUnderflowAutoStopControlDeMux class
sl@0
   128
	@return a pointer to the new class cast to the DeMux plugin mixin
sl@0
   129
	@leave  This method may leave with one of the system-wide error codes.
sl@0
   130
	*/
sl@0
   131
	static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
sl@0
   132
sl@0
   133
	/**
sl@0
   134
	Attempt to open the interface.
sl@0
   135
	@param  aInterfaceId
sl@0
   136
		    The UID of the interface to open.
sl@0
   137
	@return a handle to the remote plugin
sl@0
   138
	*/
sl@0
   139
	virtual TInt OpenInterface(TUid aInterfaceId);
sl@0
   140
sl@0
   141
	/**
sl@0
   142
	Equivalent to destructor.  Called to destroy plugin.
sl@0
   143
	*/
sl@0
   144
	virtual void Release();
sl@0
   145
sl@0
   146
	/**
sl@0
   147
	Pass destructor key.
sl@0
   148
	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
sl@0
   149
	@param aDestructorKey
sl@0
   150
		   The Uid returned by REComSession::CreateImplementationL() or similar
sl@0
   151
	*/
sl@0
   152
	virtual void PassDestructorKey(TUid aDestructorKey);
sl@0
   153
sl@0
   154
	/**
sl@0
   155
	Set the target of the custom interface call
sl@0
   156
	@param aTarget
sl@0
   157
		   The DevSound to call the custom interface on.
sl@0
   158
	*/
sl@0
   159
	virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
sl@0
   160
sl@0
   161
	/**
sl@0
   162
	Complete construction.
sl@0
   163
	@param aUtility
sl@0
   164
		   The DeMux utility to use
sl@0
   165
	@leave This method may leave with one of the system-wide error codes.
sl@0
   166
	*/
sl@0
   167
	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
sl@0
   168
sl@0
   169
	/**
sl@0
   170
	Refresh the current custom interface connections
sl@0
   171
	@leave This method may leave with one of the system-wide error codes.
sl@0
   172
	*/
sl@0
   173
	virtual void RefreshL();
sl@0
   174
sl@0
   175
	// from MMMFDevSoundCustomInterfaceDeMuxPlugin
sl@0
   176
	/**
sl@0
   177
	Open the slave
sl@0
   178
	@param  aInterface
sl@0
   179
		    The UID of the requested interface
sl@0
   180
	@param  aPackageBuf
sl@0
   181
		    A package of data that can be supplied for initialisation
sl@0
   182
	@return the result of the operation
sl@0
   183
	@leave  This method may leave with one of the system-wide error codes.
sl@0
   184
	*/
sl@0
   185
	virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
sl@0
   186
sl@0
   187
	/**
sl@0
   188
	Close the slave
sl@0
   189
	@param aHandle
sl@0
   190
		   The handle of the slave plugin
sl@0
   191
	@leave This method may leave with one of the system-wide error codes.
sl@0
   192
	*/
sl@0
   193
	virtual void DoCloseSlaveL(TInt aHandle);
sl@0
   194
sl@0
   195
	// original RMessage is supplied so that remote DeMux plugin can extract necessary details
sl@0
   196
	// using DeMux utility
sl@0
   197
sl@0
   198
	/**
sl@0
   199
	Relay the synchronous custom command onto the slave
sl@0
   200
	@param  aMessage
sl@0
   201
		    The IPC message to be sent to the slave
sl@0
   202
	@return the result of the operation
sl@0
   203
	@leave  This method may leave with one of the system-wide error codes.
sl@0
   204
	*/
sl@0
   205
	virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
sl@0
   206
sl@0
   207
	/**
sl@0
   208
	Relay the synchronous custom command onto the slave and obtain a result
sl@0
   209
	@param  aMessage
sl@0
   210
		    The IPC message to be sent to the slave
sl@0
   211
	@return the result of the operation
sl@0
   212
	@leave  This method may leave with one of the system-wide error codes.
sl@0
   213
	*/
sl@0
   214
	virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
sl@0
   215
sl@0
   216
	/**
sl@0
   217
	Relay an asynchronous command onto the slave
sl@0
   218
	@param aMessage
sl@0
   219
		   The IPC message to be sent to the slave
sl@0
   220
	@leave This method may leave with one of the system-wide error codes.
sl@0
   221
	*/
sl@0
   222
	virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
sl@0
   223
sl@0
   224
	/**
sl@0
   225
	Relay an asynchronous command onto the slave and obtain a result
sl@0
   226
	@param aMessage
sl@0
   227
		   The IPC message to be sent to the slave@param aMessage
sl@0
   228
	@leave This method may leave with one of the system-wide error codes.
sl@0
   229
	*/
sl@0
   230
	virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
sl@0
   231
sl@0
   232
protected:
sl@0
   233
	~CMMFUnderflowAutoStopControlDeMux();
sl@0
   234
	CMMFUnderflowAutoStopControlDeMux();
sl@0
   235
sl@0
   236
	// from mirror MmuascTurnOffUnderflowAutoStop method.
sl@0
   237
	TInt DoMmuascTurnOffUnderflowAutoStopL(); 
sl@0
   238
sl@0
   239
protected:
sl@0
   240
	MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
sl@0
   241
	MMMFDevSoundCustomInterfaceTarget*		 iTarget;
sl@0
   242
	TUid							iKey;
sl@0
   243
	MMMFUnderflowAutoStopControl*	iInterfaceUnderflowAutoStopCtrl; 
sl@0
   244
	};
sl@0
   245
sl@0
   246
#endif