os/mm/mmlibs/mmfw/inc/mmf/ControllerFramework/mmfcontroller.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) 2002-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
//
sl@0
    15
sl@0
    16
sl@0
    17
#ifndef __MMFCONTROLLER_H__
sl@0
    18
#define __MMFCONTROLLER_H__
sl@0
    19
sl@0
    20
#include <mmf/server/mmfdatasource.h>
sl@0
    21
#include <mmf/server/mmfdatasink.h>
sl@0
    22
#include <mmf/common/mmfcontrollerframework.h>
sl@0
    23
#include <mmf/common/mmfcontrollerpluginresolver.h>
sl@0
    24
#include <mmf/plugin/mmfplugininterfaceuids.hrh>
sl@0
    25
sl@0
    26
#include <caf/caf.h>
sl@0
    27
sl@0
    28
sl@0
    29
/**
sl@0
    30
@publishedAll
sl@0
    31
@released
sl@0
    32
sl@0
    33
Error category denoting a general controller error.
sl@0
    34
sl@0
    35
@see TMMFEvent
sl@0
    36
@since 7.0s
sl@0
    37
*/
sl@0
    38
const TUid KMMFErrorCategoryControllerGeneralError = {0x101F76D3};
sl@0
    39
sl@0
    40
/**
sl@0
    41
@publishedAll
sl@0
    42
@released
sl@0
    43
sl@0
    44
Error category denoting playback complete i.e. due to EOF or error condition
sl@0
    45
sl@0
    46
@see TMMFEvent
sl@0
    47
@since 7.0s
sl@0
    48
*/
sl@0
    49
const TUid KMMFEventCategoryPlaybackComplete = {0x101f7ea0};
sl@0
    50
sl@0
    51
/**
sl@0
    52
@publishedAll
sl@0
    53
@released
sl@0
    54
sl@0
    55
Client representation of a controller plugin for the Multimedia Framework.
sl@0
    56
sl@0
    57
This class allows a client to load a controller plugin into a new thread and access the
sl@0
    58
functionality provided by that plugin.
sl@0
    59
sl@0
    60
@since 7.0s
sl@0
    61
*/
sl@0
    62
class RMMFController
sl@0
    63
	{
sl@0
    64
public:
sl@0
    65
sl@0
    66
	IMPORT_C RMMFController();
sl@0
    67
sl@0
    68
	IMPORT_C TInt Open(TUid aControllerUid, const TMMFPrioritySettings& aPrioritySettings);
sl@0
    69
sl@0
    70
	IMPORT_C TInt Open(const CMMFControllerImplementationInformation& aControllerInfo, const TMMFPrioritySettings& aPrioritySettings);
sl@0
    71
sl@0
    72
	IMPORT_C TInt Open(TUid aControllerUid, const TMMFPrioritySettings& aPrioritySettings, TBool aUseSharedHeap );
sl@0
    73
sl@0
    74
	IMPORT_C TInt Open(const CMMFControllerImplementationInformation& aControllerInfo, const TMMFPrioritySettings& aPrioritySettings, TBool aUseSharedHeap );
sl@0
    75
	
sl@0
    76
	IMPORT_C TInt OpenInSecureDRMProcess(TUid aControllerUid, const TMMFPrioritySettings& aPrioritySettings);
sl@0
    77
	
sl@0
    78
	IMPORT_C TInt OpenInSecureDRMProcess(const CMMFControllerImplementationInformation& aControllerInfo, const TMMFPrioritySettings& aPrioritySettings);
sl@0
    79
sl@0
    80
	IMPORT_C TInt OpenInSecureDRMProcess(TUid aControllerUid, const TMMFPrioritySettings& aPrioritySettings, TBool aUseSharedHeap );
sl@0
    81
sl@0
    82
	IMPORT_C TInt OpenInSecureDRMProcess(const CMMFControllerImplementationInformation& aControllerInfo, const TMMFPrioritySettings& aPrioritySettings, TBool aUseSharedHeap );
sl@0
    83
	
sl@0
    84
	IMPORT_C void Close();
sl@0
    85
sl@0
    86
	IMPORT_C TInt SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings) const;
sl@0
    87
sl@0
    88
	IMPORT_C TInt AddDataSource(TUid aSourceUid, const TDesC8& aSourceInitData);
sl@0
    89
sl@0
    90
	IMPORT_C TInt AddDataSink(TUid aSinkUid, const TDesC8& aSinkInitData);
sl@0
    91
sl@0
    92
	IMPORT_C TInt AddDataSource(TUid aSourceUid, const TDesC8& aSourceInitData, TMMFMessageDestination& aHandleInfo);
sl@0
    93
	
sl@0
    94
	IMPORT_C TInt AddDataSink(TUid aSinkUid, const TDesC8& aSinkInitData, TMMFMessageDestination& aHandleInfo);
sl@0
    95
sl@0
    96
	IMPORT_C void AddDataSource(const TMMFUidPckg& aSourceUid, const TDesC8& aSourceInitData, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
sl@0
    97
	IMPORT_C void AddFileHandleDataSource(const RFile& aFile, const TDesC8& aSourceInitData, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
sl@0
    98
	IMPORT_C void AddFileHandleDataSource(const RFile& aFile, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
sl@0
    99
	
sl@0
   100
	IMPORT_C void CancelAddDataSource();
sl@0
   101
	
sl@0
   102
	IMPORT_C void AddDataSink(const TMMFUidPckg& aSinkUid, const TDesC8& aSinkInitData, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
sl@0
   103
	IMPORT_C void AddFileHandleDataSink(const RFile& aFile, const TDesC8& aSinkInitData, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
sl@0
   104
	IMPORT_C void AddFileHandleDataSink(const RFile& aFile, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
sl@0
   105
	
sl@0
   106
	IMPORT_C void CancelAddDataSink();
sl@0
   107
sl@0
   108
	IMPORT_C TInt RemoveDataSource(const TMMFMessageDestination& aSourceHandleInfo);
sl@0
   109
sl@0
   110
	IMPORT_C TInt RemoveDataSink(const TMMFMessageDestination& aSinkHandleInfo);
sl@0
   111
sl@0
   112
	IMPORT_C TInt Reset();
sl@0
   113
sl@0
   114
	IMPORT_C TInt Prime();
sl@0
   115
sl@0
   116
	IMPORT_C TInt Play();
sl@0
   117
sl@0
   118
	IMPORT_C TInt Pause();
sl@0
   119
sl@0
   120
	IMPORT_C TInt Stop();
sl@0
   121
sl@0
   122
	IMPORT_C TInt GetPosition(TTimeIntervalMicroSeconds& aPosition) const;
sl@0
   123
sl@0
   124
	IMPORT_C TInt SetPosition(const TTimeIntervalMicroSeconds& aPosition) const;
sl@0
   125
sl@0
   126
	IMPORT_C TInt GetDuration(TTimeIntervalMicroSeconds& aDuration) const;
sl@0
   127
sl@0
   128
	IMPORT_C TInt GetNumberOfMetaDataEntries(TInt& aNumberOfEntries) const;
sl@0
   129
sl@0
   130
	IMPORT_C CMMFMetaDataEntry* GetMetaDataEntryL(TInt aIndex) const;
sl@0
   131
sl@0
   132
	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
sl@0
   133
sl@0
   134
	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
sl@0
   135
sl@0
   136
	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
sl@0
   137
sl@0
   138
	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
sl@0
   139
sl@0
   140
	IMPORT_C void ReceiveEvents(TMMFEventPckg& aEventPckg, TRequestStatus& aStatus);
sl@0
   141
sl@0
   142
	IMPORT_C TInt CancelReceiveEvents();
sl@0
   143
	
sl@0
   144
	IMPORT_C TInt SetThreadPriority(const TThreadPriority& aPriority) const;
sl@0
   145
	
sl@0
   146
private:
sl@0
   147
	/**
sl@0
   148
	The controller proxy.  Used to pass messages to the controller thread.
sl@0
   149
	*/
sl@0
   150
	RMMFControllerProxy iControllerProxy;
sl@0
   151
sl@0
   152
	/**
sl@0
   153
	Used to hold the destination information for messages for the standard controller plugin interface.
sl@0
   154
	*/
sl@0
   155
	TMMFMessageDestinationPckg iDestinationPckg;
sl@0
   156
	};
sl@0
   157
sl@0
   158
sl@0
   159
/**
sl@0
   160
@publishedAll
sl@0
   161
@released
sl@0
   162
sl@0
   163
Defines an object to which a client may have a direct handle.
sl@0
   164
sl@0
   165
This class provides a way of identifying objects within the controller framework, and a means
sl@0
   166
of passing commands to those objects.
sl@0
   167
sl@0
   168
@since  7.0s
sl@0
   169
*/
sl@0
   170
class CMMFObject : public CBase
sl@0
   171
	{
sl@0
   172
friend class CMMFObjectContainer;//to set the handle
sl@0
   173
public:
sl@0
   174
	IMPORT_C ~CMMFObject();
sl@0
   175
sl@0
   176
	IMPORT_C CMMFObject(TUid aInterfaceId);
sl@0
   177
sl@0
   178
	IMPORT_C const TMMFMessageDestination& Handle();
sl@0
   179
sl@0
   180
	IMPORT_C TBool operator==(const CMMFObject& aOther);
sl@0
   181
sl@0
   182
	/**
sl@0
   183
	Passes a message to the object to handle.
sl@0
   184
sl@0
   185
	This is a pure virtual method to be implemented by concrete classes derived from this class.
sl@0
   186
sl@0
   187
	The message passed in MUST be completed by the object; however, it can be copied to be
sl@0
   188
	completed at a later time, should some other asynchronous action need to occur first.
sl@0
   189
sl@0
   190
	@param  aMessage
sl@0
   191
	        The message to be handled.  This MUST be completed by the object.
sl@0
   192
sl@0
   193
	@since  7.0s
sl@0
   194
	*/
sl@0
   195
	virtual void HandleRequest(TMMFMessage& aMessage) = 0;
sl@0
   196
private:
sl@0
   197
	void SetHandle(const TMMFMessageDestination& aNewHandle);
sl@0
   198
private:
sl@0
   199
	TMMFMessageDestination iHandle;
sl@0
   200
	};
sl@0
   201
sl@0
   202
/**
sl@0
   203
@publishedAll
sl@0
   204
@released
sl@0
   205
sl@0
   206
Container class to hold the CMMFObject-derived objects in the controller framework.
sl@0
   207
sl@0
   208
@since 7.0s
sl@0
   209
*/
sl@0
   210
class CMMFObjectContainer : public CBase
sl@0
   211
	{
sl@0
   212
public:
sl@0
   213
sl@0
   214
	IMPORT_C CMMFObjectContainer();
sl@0
   215
sl@0
   216
	IMPORT_C ~CMMFObjectContainer();
sl@0
   217
sl@0
   218
	IMPORT_C TInt AddMMFObject(CMMFObject& aObject);
sl@0
   219
sl@0
   220
	IMPORT_C void RemoveAndDestroyMMFObject(CMMFObject& aObject);
sl@0
   221
sl@0
   222
	IMPORT_C TInt FindMMFObject(const TMMFMessageDestination& aObjectHandle, CMMFObject*& aObjectFound);
sl@0
   223
sl@0
   224
	IMPORT_C void DeleteAllObjects();
sl@0
   225
	
sl@0
   226
	const RPointerArray<CMMFObject>& MMFObjects();
sl@0
   227
	
sl@0
   228
private:
sl@0
   229
	/**
sl@0
   230
	Internal method to find an object in the array.
sl@0
   231
	*/
sl@0
   232
	TInt FindMMFObject(const CMMFObject& aObject, TInt& aPositionInArray);
sl@0
   233
sl@0
   234
	/**
sl@0
   235
	Internal method used to generate the object handle for a newly added object.
sl@0
   236
	*/
sl@0
   237
	TInt GenerateObjectHandle();
sl@0
   238
private:
sl@0
   239
	/**
sl@0
   240
	The array of objects.
sl@0
   241
	*/
sl@0
   242
	RPointerArray<CMMFObject> iObjects;
sl@0
   243
sl@0
   244
	/**
sl@0
   245
	The next available object handle.
sl@0
   246
	*/
sl@0
   247
	TInt iNextObjectHandle;
sl@0
   248
	};
sl@0
   249
sl@0
   250
sl@0
   251
/**
sl@0
   252
@publishedAll
sl@0
   253
@released
sl@0
   254
sl@0
   255
CMMFObject-derived class to wrap a Data Source.
sl@0
   256
sl@0
   257
Allows a handle to be attributed to a data source, so it can be removed from the controller and
sl@0
   258
the client can send messages directly to it.
sl@0
   259
sl@0
   260
@since 7.0s
sl@0
   261
*/
sl@0
   262
class CMMFDataSourceHolder : public CMMFObject
sl@0
   263
	{
sl@0
   264
public:
sl@0
   265
sl@0
   266
	IMPORT_C CMMFDataSourceHolder(MDataSource& aDataSource);
sl@0
   267
sl@0
   268
	IMPORT_C ~CMMFDataSourceHolder();
sl@0
   269
sl@0
   270
	IMPORT_C MDataSource& DataSource();
sl@0
   271
sl@0
   272
	//from CMMFObject
sl@0
   273
	IMPORT_C void HandleRequest(TMMFMessage& aMessage);
sl@0
   274
private:
sl@0
   275
	/**
sl@0
   276
	Pointer to the data source owned by this object.
sl@0
   277
	*/
sl@0
   278
	MDataSource* iDataSource;
sl@0
   279
	};
sl@0
   280
sl@0
   281
/**
sl@0
   282
@publishedAll
sl@0
   283
@released
sl@0
   284
sl@0
   285
CMMFObject-derived class to wrap a Data Sink.
sl@0
   286
sl@0
   287
Allows a handle to be attributed to a data sink, so it can be removed from the controller and
sl@0
   288
the client can send messages directly to it.
sl@0
   289
sl@0
   290
@since 7.0s
sl@0
   291
*/
sl@0
   292
class CMMFDataSinkHolder : public CMMFObject
sl@0
   293
	{
sl@0
   294
public:
sl@0
   295
	IMPORT_C CMMFDataSinkHolder(MDataSink& aDataSink);
sl@0
   296
sl@0
   297
	IMPORT_C ~CMMFDataSinkHolder();
sl@0
   298
sl@0
   299
	IMPORT_C MDataSink& DataSink();
sl@0
   300
sl@0
   301
	//from CMMFObject
sl@0
   302
	IMPORT_C void HandleRequest(TMMFMessage& aMessage);
sl@0
   303
sl@0
   304
private:
sl@0
   305
	/**
sl@0
   306
	Pointer to the data sink owned by this object.
sl@0
   307
	*/
sl@0
   308
	MDataSink* iDataSink;
sl@0
   309
	};
sl@0
   310
sl@0
   311
sl@0
   312
/**
sl@0
   313
@publishedAll
sl@0
   314
@released
sl@0
   315
sl@0
   316
Base class for client-side custom command classes.
sl@0
   317
sl@0
   318
In order facilitate the use of the more common custom commands, it is desirable to write
sl@0
   319
a concrete API class for the client to use.  This API class can then be use to wrap all the code
sl@0
   320
involved to formulate the custom command messages.
sl@0
   321
sl@0
   322
@since 7.0s
sl@0
   323
*/
sl@0
   324
class RMMFCustomCommandsBase
sl@0
   325
	{
sl@0
   326
public:
sl@0
   327
sl@0
   328
	IMPORT_C RMMFCustomCommandsBase(RMMFController& aController, TUid aInterfaceId);
sl@0
   329
protected:
sl@0
   330
	/**
sl@0
   331
	The controller.
sl@0
   332
sl@0
   333
	Derived classes should use iController.CustomCommandSync() and
sl@0
   334
	iController.CustomCommandAsync() to send the custom commands to the controller
sl@0
   335
	plugin.
sl@0
   336
	*/
sl@0
   337
	RMMFController& iController;
sl@0
   338
sl@0
   339
	/**
sl@0
   340
	The destination package.
sl@0
   341
sl@0
   342
	Derived classes must pass this into iController.CustomCommandSync() and
sl@0
   343
	iController.CustomCommandAsync() as the destination argument.
sl@0
   344
	*/
sl@0
   345
	TMMFMessageDestinationPckg iDestinationPckg;
sl@0
   346
	};
sl@0
   347
sl@0
   348
/**
sl@0
   349
@publishedAll
sl@0
   350
@released
sl@0
   351
sl@0
   352
Base class to define the interface of a custom command parser.
sl@0
   353
sl@0
   354
In order to facilitate the support of common custom commands by controller plugins, a
sl@0
   355
custom command parser object can be used.  A set of custom command parsers are created
sl@0
   356
by the controller plugin (one for each interface supported), and added to the custom command
sl@0
   357
parser manager in the controller framework.  The controller plugin must also derive from a set of
sl@0
   358
concrete interfaces (provided in the form of mixin classes). Then, a custom command supported by
sl@0
   359
one of the custom command parsers will appear to the controller as a concrete API call, rather than
sl@0
   360
a call to its own custom command API.
sl@0
   361
sl@0
   362
@since 7.0s
sl@0
   363
*/
sl@0
   364
class CMMFCustomCommandParserBase : public CBase
sl@0
   365
	{
sl@0
   366
public:
sl@0
   367
sl@0
   368
	/**
sl@0
   369
	Pure virtual method to be implemented by derived classes.
sl@0
   370
sl@0
   371
	Derived classes must implement the code to decode the message from the client.
sl@0
   372
sl@0
   373
	@param  aMessage
sl@0
   374
	        The message to be serviced. This message must be completed by the derived class.
sl@0
   375
sl@0
   376
	@since 7.0s
sl@0
   377
	*/
sl@0
   378
	virtual void HandleRequest(TMMFMessage& aMessage) = 0;
sl@0
   379
sl@0
   380
	/**
sl@0
   381
	Returns the UID of the custom command interface provided by this parser.
sl@0
   382
sl@0
   383
	@return The interface UID.
sl@0
   384
sl@0
   385
	@since  7.0s
sl@0
   386
	*/
sl@0
   387
	IMPORT_C TUid InterfaceId();
sl@0
   388
sl@0
   389
	/**
sl@0
   390
	Destructor.
sl@0
   391
sl@0
   392
	@since 7.0s
sl@0
   393
	*/
sl@0
   394
	IMPORT_C ~CMMFCustomCommandParserBase();
sl@0
   395
protected:
sl@0
   396
sl@0
   397
	/**
sl@0
   398
	Constructor.
sl@0
   399
sl@0
   400
	@param  aInterfaceId
sl@0
   401
	        The uid of the custom command interface provided by this parser.
sl@0
   402
	        This must be the same as the interface id of the corresponding client
sl@0
   403
	        API class. See RMMFCustomCommandsBase.
sl@0
   404
sl@0
   405
	@since  7.0s
sl@0
   406
	*/
sl@0
   407
	IMPORT_C CMMFCustomCommandParserBase(TUid aInterfaceId);
sl@0
   408
sl@0
   409
private:
sl@0
   410
sl@0
   411
	/**
sl@0
   412
	The uid of the custom command interface provided by this parser.
sl@0
   413
	*/
sl@0
   414
	TUid iInterfaceId;
sl@0
   415
	};
sl@0
   416
sl@0
   417
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
   418
#include <mmf/common/mmfcontrollerextendeddata.h>
sl@0
   419
#include <mmf/common/mmfcustomcommandparsermanager.h>
sl@0
   420
#endif
sl@0
   421
sl@0
   422
sl@0
   423
class CMMFControllerExtendedData;
sl@0
   424
class CMMFCustomCommandParserManager;
sl@0
   425
/**
sl@0
   426
@publishedAll
sl@0
   427
@released
sl@0
   428
sl@0
   429
Base class for controller plugins.
sl@0
   430
sl@0
   431
A controller plugin for the multimedia framework must derive from this class and implement
sl@0
   432
all the pure virtual functions.
sl@0
   433
sl@0
   434
Controller plugins control the flow of multimedia data from one or more sources to one or
sl@0
   435
more sinks. For example, an audio controller plugin might take data from a file source and
sl@0
   436
output it to a speaker sink, or take data from a microphone source and save it to a file
sl@0
   437
sink. A controller plugin typically supports one or more multimedia formats, for example
sl@0
   438
WAV or MPEG4.
sl@0
   439
sl@0
   440
@since 7.0s
sl@0
   441
*/
sl@0
   442
class CMMFController : public CBase
sl@0
   443
	{
sl@0
   444
public:
sl@0
   445
sl@0
   446
	/**
sl@0
   447
	Allocates and constructs a new controller plugin.
sl@0
   448
sl@0
   449
	Uses ECOM to instantiate a new controller plugin. Can leave with any of the system-wide error codes.
sl@0
   450
sl@0
   451
	@param  aControllerUid
sl@0
   452
	        The unique ID of the controller to be instantiated from ECOM.
sl@0
   453
	@param  aEventHandler
sl@0
   454
	        A reference to an event handling object that can be used by the
sl@0
   455
	        controller to send events back to the client.
sl@0
   456
	@param 	aClientTid
sl@0
   457
			The thread Id of the client thread
sl@0
   458
sl@0
   459
	@return A pointer to the new controller plugin.
sl@0
   460
sl@0
   461
	@since	7.0s
sl@0
   462
	*/
sl@0
   463
	static CMMFController* NewL(TUid aControllerUid, MAsyncEventHandler& aEventHandler, TThreadId aClientTid);
sl@0
   464
sl@0
   465
	/**
sl@0
   466
	Handles a message from the client.
sl@0
   467
sl@0
   468
	Decodes the message and calls one of the private DoXxx methods to unpackaged the parameters.
sl@0
   469
sl@0
   470
	@param  aMessage
sl@0
   471
	        The message to be handled.
sl@0
   472
sl@0
   473
	@since  7.0s
sl@0
   474
	*/
sl@0
   475
	IMPORT_C virtual void HandleRequestL(TMMFMessage& aMessage);
sl@0
   476
sl@0
   477
	/**
sl@0
   478
	Default destructor.
sl@0
   479
	*/
sl@0
   480
	IMPORT_C virtual ~CMMFController();
sl@0
   481
protected:
sl@0
   482
sl@0
   483
	/**
sl@0
   484
	Constructor.
sl@0
   485
	*/
sl@0
   486
	CMMFController() {};
sl@0
   487
sl@0
   488
	// virtual functions to be implemented by controller plugin
sl@0
   489
sl@0
   490
	/**
sl@0
   491
	Add a data source to the controller plugin.
sl@0
   492
sl@0
   493
	NOTE: The data source is owned by the controller framework, NOT by the controller plugin.
sl@0
   494
	Under no circumstances should the controller plugin delete the data source.
sl@0
   495
sl@0
   496
	@param  aDataSource
sl@0
   497
	        A reference to the data source to be added.  The controller plugin
sl@0
   498
	        may call aDataSource.DataSourceType() to find out
sl@0
   499
	        exactly what type of source it is.
sl@0
   500
sl@0
   501
	@leave  KErrNotSupported
sl@0
   502
	        If the controller plugin does not support the data source, it should leave with this.
sl@0
   503
sl@0
   504
	@since  7.0s
sl@0
   505
	*/
sl@0
   506
	virtual void AddDataSourceL(MDataSource& aDataSource) = 0;
sl@0
   507
sl@0
   508
	/**
sl@0
   509
	Adds a data sink to the controller plugin.
sl@0
   510
sl@0
   511
	NOTE: The data sink is owned by the controller framework, NOT by the controller plugin.
sl@0
   512
	Under no circumstances should the controller plugin delete the data sink.
sl@0
   513
sl@0
   514
	@param  aDataSink
sl@0
   515
	        A reference to the data sink to be added.  The controller plugin
sl@0
   516
	        may call aDatasink.DatasinkType() to find out
sl@0
   517
            exactly what type of sink it is.
sl@0
   518
sl@0
   519
	@leave  KErrNotSupported
sl@0
   520
	        If the controller plugin does not support the data sink, it should leave with this.
sl@0
   521
sl@0
   522
	@since 7.0s
sl@0
   523
	*/
sl@0
   524
	virtual void AddDataSinkL(MDataSink& aDataSink) = 0;
sl@0
   525
sl@0
   526
	/**
sl@0
   527
	Removes a data source from the controller plugin.
sl@0
   528
sl@0
   529
	Note:
sl@0
   530
	The data source is owned by the controller framework, NOT by the controller plugin.
sl@0
   531
	Under no circumstances should the controller plugin delete the data source.
sl@0
   532
sl@0
   533
	@param  aDataSource
sl@0
   534
	        A reference to the data source to be removed.
sl@0
   535
sl@0
   536
	@leave  KErrNotSupported
sl@0
   537
	        The controller plugin may leave during this method.  If the controller plugin does
sl@0
   538
	        not support the removal of data sources, it should leave with
sl@0
   539
	        KErrNotSupported. If the controller plugin leaves, the data source will
sl@0
   540
	        not be destroyed by the controller framework.  If it does not leave, the data source
sl@0
   541
	        will be destroyed.
sl@0
   542
sl@0
   543
	@since 7.0s
sl@0
   544
	*/
sl@0
   545
	virtual void RemoveDataSourceL(MDataSource& aDataSource) = 0;
sl@0
   546
sl@0
   547
	/**
sl@0
   548
	Removes a data sink from the controller plugin.
sl@0
   549
sl@0
   550
	Note:
sl@0
   551
	The data sink is owned by the controller framework, NOT by the controller plugin.
sl@0
   552
	Under no circumstances should the controller plugin delete the data sink.
sl@0
   553
sl@0
   554
	@param  aDataSink
sl@0
   555
	        A reference to the data sink to be removed.
sl@0
   556
sl@0
   557
	@leave  KErrNotSupported
sl@0
   558
	        The controller plugin may leave during this method.  If the controller plugin does
sl@0
   559
	        not support the removal of data sinks, it should leave with
sl@0
   560
	        KErrNotSupported. If the controller plugin leaves, the data sink will
sl@0
   561
	        not be destroyed by the controller framework.  If it does not leave, the data sink
sl@0
   562
	        will be destroyed.
sl@0
   563
sl@0
   564
	@since  7.0s
sl@0
   565
	*/
sl@0
   566
	virtual void RemoveDataSinkL(MDataSink& aDataSink) = 0;
sl@0
   567
sl@0
   568
	/**
sl@0
   569
	Resets the controller plugin.
sl@0
   570
sl@0
   571
	The controller should revert back to its newly constructed state. If the Reset is successful
sl@0
   572
	(i.e. it doesn't leave), the controller framework will delete all objects added to the
sl@0
   573
	MMFObjectManager including any sources and sinks.
sl@0
   574
sl@0
   575
	@leave  KErrNotSupported
sl@0
   576
	        If the controller plugin does not support being reset, it should leave with KErrNotSupported.
sl@0
   577
sl@0
   578
	@since  7.0s
sl@0
   579
	*/
sl@0
   580
	virtual void ResetL() = 0;
sl@0
   581
sl@0
   582
	/**
sl@0
   583
	Primes the controller plugin.
sl@0
   584
sl@0
   585
	The controller must prepare to start playing, by initialising its sources, sinks and buffers.
sl@0
   586
	This moves the controller from the STOPPED to the PRIMED state.
sl@0
   587
sl@0
   588
	@since  7.0s
sl@0
   589
	*/
sl@0
   590
	virtual void PrimeL() = 0;
sl@0
   591
sl@0
   592
	/**
sl@0
   593
	A partner to the PrimeL() method that is overridable to allow Asynchronous
sl@0
   594
	completion in the controller whilst maintaining a Synchronous client API.
sl@0
   595
sl@0
   596
	The default implementation of this is to call PrimeL() and complete the message with KErrNone.
sl@0
   597
sl@0
   598
	@since  7.0s
sl@0
   599
	*/
sl@0
   600
	IMPORT_C virtual void PrimeL(TMMFMessage& aMessage);
sl@0
   601
sl@0
   602
	/**
sl@0
   603
	Commences playback.
sl@0
   604
sl@0
   605
	The controller must now begin transferring data from its source(s) to its sink(s).
sl@0
   606
	This moves the controller from the PRIMED to the PLAYING state.
sl@0
   607
sl@0
   608
	Note:
sl@0
   609
	This method must return once playing has commenced, and not wait until playing is complete.
sl@0
   610
sl@0
   611
	@since  7.0s
sl@0
   612
	*/
sl@0
   613
	virtual void PlayL()= 0;
sl@0
   614
sl@0
   615
	/**
sl@0
   616
	A partner to the PlayL() method that is overridable to allow Asynchronous
sl@0
   617
	completion in the controller whilst maintaining a Synchronous client API.
sl@0
   618
sl@0
   619
	The default implementation of this is to call PlayL() and complete the message with KErrNone.
sl@0
   620
sl@0
   621
	@since  7.0s
sl@0
   622
	*/
sl@0
   623
	IMPORT_C virtual void PlayL(TMMFMessage& aMessage);
sl@0
   624
sl@0
   625
sl@0
   626
	/**
sl@0
   627
	Pauses the controller plugin.
sl@0
   628
sl@0
   629
	The controller must now cease transferring data from its source(s) to its sink(s).
sl@0
   630
	This moves the controller from the PLAYING back to the PRIMED state.
sl@0
   631
sl@0
   632
	A subsequent call to Play() will cause the controller plugin to resume playback
sl@0
   633
	from the point it was paused (unless there has been a call to SetPosition() in
sl@0
   634
	the meantime.
sl@0
   635
sl@0
   636
	@since  7.0s
sl@0
   637
	*/
sl@0
   638
	virtual void PauseL()= 0;
sl@0
   639
sl@0
   640
	/**
sl@0
   641
	A partner to the PauseL() method that is overridable to allow Asynchronous
sl@0
   642
	completion in the controller whilst maintaining a Synchronous client API.
sl@0
   643
sl@0
   644
	The default implementation of this is to call PauseL() and complete the message with KErrNone.
sl@0
   645
sl@0
   646
	@since  7.0s
sl@0
   647
	*/
sl@0
   648
	IMPORT_C virtual void PauseL(TMMFMessage& aMessage);
sl@0
   649
sl@0
   650
	/**
sl@0
   651
	Stops the controller plugin.
sl@0
   652
sl@0
   653
	The controller must now undo anything that occurred during the call to Prime().
sl@0
   654
	This moves the controller from the PRIMED back to the STOPPED state.
sl@0
   655
sl@0
   656
	@since  7.0s
sl@0
   657
	*/
sl@0
   658
	virtual void StopL()= 0;
sl@0
   659
sl@0
   660
	/**
sl@0
   661
	A partner to the StopL() method that is overridable to allow Asynchronous
sl@0
   662
	completion in the controller whilst maintaining a Synchronous client API.
sl@0
   663
sl@0
   664
	The default implementation of this is to call StopL() and complete the message with KErrNone.
sl@0
   665
sl@0
   666
	@since  7.0s
sl@0
   667
	*/
sl@0
   668
	IMPORT_C virtual void StopL(TMMFMessage& aMessage);
sl@0
   669
sl@0
   670
	/**
sl@0
   671
	Gets the current position.
sl@0
   672
sl@0
   673
	The controller plugin should calculate the current position in microseconds.
sl@0
   674
sl@0
   675
	@return The current position in microseconds.
sl@0
   676
sl@0
   677
	@since  7.0s
sl@0
   678
	*/
sl@0
   679
	virtual TTimeIntervalMicroSeconds PositionL() const = 0;
sl@0
   680
sl@0
   681
	/**
sl@0
   682
	Sets the current position.
sl@0
   683
sl@0
   684
	The controller plugin should reposition itself to the position provided.
sl@0
   685
sl@0
   686
	@param  aPosition
sl@0
   687
	        The desired position in microseconds.
sl@0
   688
sl@0
   689
	@since  7.0s
sl@0
   690
	*/
sl@0
   691
	virtual void SetPositionL(const TTimeIntervalMicroSeconds& aPosition) = 0;
sl@0
   692
sl@0
   693
	/**
sl@0
   694
	Gets the duration of the clip.
sl@0
   695
sl@0
   696
	The controller plugin should calculate the clip duration in microseconds.
sl@0
   697
sl@0
   698
	@return The clips duration in microseconds.
sl@0
   699
sl@0
   700
	@since  7.0s
sl@0
   701
	*/
sl@0
   702
	virtual TTimeIntervalMicroSeconds DurationL() const = 0;
sl@0
   703
sl@0
   704
	/**
sl@0
   705
	Sets the priority settings.
sl@0
   706
sl@0
   707
	The new priority settings must be applied to any resource being used by the controller
sl@0
   708
	plugin that requires priority settings (for example the sound device).
sl@0
   709
sl@0
   710
	@param  aPrioritySettings
sl@0
   711
	        The new priority settings
sl@0
   712
sl@0
   713
	@since  7.0s
sl@0
   714
sl@0
   715
	*/
sl@0
   716
	virtual void SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings) = 0;
sl@0
   717
sl@0
   718
	/**
sl@0
   719
	Handles a custom command.
sl@0
   720
sl@0
   721
	Custom commands allow a controller plugin to define its own API.  If the controller framework
sl@0
   722
	does not understand a message from the client, it is assumed this is a custom command for the
sl@0
   723
	plugin and passed into this interface.
sl@0
   724
sl@0
   725
	The more common custom commands can be handled by Custom Command Parsers on behalf of the
sl@0
   726
	controller plugin.  This allows the controller plugin to implement a concrete interface
sl@0
   727
	(defined by mixin classes) rather than having to decode the command itself.  For more
sl@0
   728
	information, see CMMFCustomCommandParserBase.
sl@0
   729
sl@0
   730
	The controller plugin must always complete the message passed into this method,
sl@0
   731
	even if it does not support the interface required by the message.
sl@0
   732
sl@0
   733
	@param  aMessage
sl@0
   734
	        The message to be handled by the controller plugin.
sl@0
   735
sl@0
   736
    @see    CMMFCustomCommandParserBase.
sl@0
   737
	@since 7.0s
sl@0
   738
	*/
sl@0
   739
	virtual void CustomCommand(TMMFMessage& aMessage)
sl@0
   740
		{aMessage.Complete(KErrNotSupported);};//default implementation
sl@0
   741
sl@0
   742
	/**
sl@0
   743
	RetrieveS the number of meta data entries in the clip.
sl@0
   744
sl@0
   745
	@param  aNumberOfEntries
sl@0
   746
	        The controller plugin must set this to the number of meta data entries
sl@0
   747
	        in the clip.
sl@0
   748
sl@0
   749
	@since  7.0s
sl@0
   750
	*/
sl@0
   751
	virtual void GetNumberOfMetaDataEntriesL(TInt& aNumberOfEntries) = 0;
sl@0
   752
sl@0
   753
	/**
sl@0
   754
	Retrieves a meta data entry from the clip.
sl@0
   755
sl@0
   756
	@param  aIndex
sl@0
   757
	        The index of the meta data entry to retrieve.
sl@0
   758
sl@0
   759
	@return A pointer to a newly created CMMFMetaDataEntry object containing the meta information.
sl@0
   760
	        The controller framework will take ownership of the object when this method returns.
sl@0
   761
sl@0
   762
	@since  7.0s
sl@0
   763
	*/
sl@0
   764
	virtual CMMFMetaDataEntry* GetMetaDataEntryL(TInt aIndex) = 0;
sl@0
   765
sl@0
   766
	// Utility functions to be used by controller plugins
sl@0
   767
sl@0
   768
	/**
sl@0
   769
	Sends an event to the client.
sl@0
   770
sl@0
   771
	The controller plugin can use this method to send an event to the client.
sl@0
   772
sl@0
   773
	@param  aEvent
sl@0
   774
	        The event to be sent to the client.
sl@0
   775
	@return One of the system-wide error codes.
sl@0
   776
sl@0
   777
	@since 7.0s
sl@0
   778
	*/
sl@0
   779
	IMPORT_C TInt DoSendEventToClient(const TMMFEvent& aEvent);
sl@0
   780
sl@0
   781
	/**
sl@0
   782
	Gets a reference to the multimedia framework object container.
sl@0
   783
sl@0
   784
	The controller plugin may add CMMFObject-derived objects to the container to allow them
sl@0
   785
	to receive messages directly from the client.
sl@0
   786
sl@0
   787
	@return A reference to the MMFObjectContainer.
sl@0
   788
sl@0
   789
	@since  7.0s
sl@0
   790
	*/
sl@0
   791
	IMPORT_C CMMFObjectContainer& MMFObjectContainerL();
sl@0
   792
sl@0
   793
	/**
sl@0
   794
	Adds a custom command parser to the controller framework.
sl@0
   795
sl@0
   796
	If the controller framework receives a request it does not understand, it will
sl@0
   797
	search through its list of custom command parsers before passing the request
sl@0
   798
	on to the controller plugin as a custom command.
sl@0
   799
sl@0
   800
	By using the custom command parsers, the controller plugin can implement a concrete
sl@0
   801
	API rather than having to decode the common custom commands itself.
sl@0
   802
sl@0
   803
	@param  aParser
sl@0
   804
	        The parser to be added to the controller framework. The controller framework
sl@0
   805
	        takes ownership of the parser if the call does not leave.
sl@0
   806
sl@0
   807
	@since  7.0s
sl@0
   808
	*/
sl@0
   809
	IMPORT_C void AddCustomCommandParserL(CMMFCustomCommandParserBase& aParser);
sl@0
   810
sl@0
   811
	/**
sl@0
   812
	Retrieves the client thread Id of this controller.
sl@0
   813
sl@0
   814
	@return Thread Id of the controller's client
sl@0
   815
	*/
sl@0
   816
	IMPORT_C TThreadId ClientThreadIdL();
sl@0
   817
	
sl@0
   818
	/**
sl@0
   819
	Check the Secure DRM Mode of current controller object
sl@0
   820
sl@0
   821
	@return ETrue if the controller is running under Secure DRM mode; otherwise EFalse.
sl@0
   822
	*/
sl@0
   823
	IMPORT_C TBool IsSecureDrmModeL();
sl@0
   824
	
sl@0
   825
private:
sl@0
   826
	/**
sl@0
   827
	This is internal and not intended for use.
sl@0
   828
	*/
sl@0
   829
	void ConstructL(MAsyncEventHandler& aEventHandler, TThreadId aClientTid);
sl@0
   830
	// IPC decode functions
sl@0
   831
	TBool DoAddDataSourceL(TMMFMessage& aMessage);
sl@0
   832
	TBool DoAddDataSinkL(TMMFMessage& aMessage);
sl@0
   833
	TBool DoAddFileHandleDataSourceL(TMMFMessage& aMessage);
sl@0
   834
	TBool DoAddFileHandleDataSinkL(TMMFMessage& aMessage);
sl@0
   835
	TBool DoRemoveDataSourceL(TMMFMessage& aMessage);
sl@0
   836
	TBool DoRemoveDataSinkL(TMMFMessage& aMessage);
sl@0
   837
	TBool DoResetL(TMMFMessage& aMessage);
sl@0
   838
	TBool DoPrimeL(TMMFMessage& aMessage);
sl@0
   839
	TBool DoPlayL(TMMFMessage& aMessage);
sl@0
   840
	TBool DoPauseL(TMMFMessage& aMessage);
sl@0
   841
	TBool DoStopL(TMMFMessage& aMessage);
sl@0
   842
	TBool DoGetPositionL(TMMFMessage& aMessage);
sl@0
   843
	TBool DoSetPositionL(TMMFMessage& aMessage);
sl@0
   844
	TBool DoGetDurationL(TMMFMessage& aMessage);
sl@0
   845
	TBool DoSetPrioritySettingsL(TMMFMessage& aMessage);
sl@0
   846
	void DoCustomCommand(TMMFMessage& aMessage);
sl@0
   847
	TBool DoGetNumberOfMetaDataEntriesL(TMMFMessage& aMessage);
sl@0
   848
	TBool DoGetSizeOfMetaDataEntryL(TMMFMessage& aMessage);
sl@0
   849
	TBool DoGetMetaDataEntryL(TMMFMessage& aMessage);
sl@0
   850
	TBool DoPreloadSourceSinkInitDataL(TMMFMessage& aMessage);
sl@0
   851
	TBool DoAddFileHandleDataSourceWithInitDataL(TMMFMessage& aMessage);
sl@0
   852
	TBool DoAddFileHandleDataSinkWithInitDataL(TMMFMessage& aMessage);
sl@0
   853
	void ReplaceFileHandleInInitDataL(RFile* aFile, TDes8& aInitData);
sl@0
   854
	// Ownership of aSource is taken into this function
sl@0
   855
	void AddMDataSourceAndRepondClientL(MDataSource* aSource, TMMFMessage& aMessage);
sl@0
   856
	// Ownership of aSink is taken into this function
sl@0
   857
	void AddMDataSinkAndRepondClientL(MDataSink* aSink, TMMFMessage& aMessage);
sl@0
   858
	CMMFControllerExtendedData* GetExtendedDataL();
sl@0
   859
	static CMMFControllerExtendedData* CreateExtendedDataL(TThreadId aClientTid);
sl@0
   860
	
sl@0
   861
private:
sl@0
   862
	/**
sl@0
   863
	Buffer to assist copy of meta data over the thread boundary.
sl@0
   864
	*/
sl@0
   865
	CBufFlat* iMetaDataBuffer;
sl@0
   866
	
sl@0
   867
	/**
sl@0
   868
	Required by ECOM.
sl@0
   869
	*/
sl@0
   870
	TUid iDtor_ID_Key;
sl@0
   871
sl@0
   872
	/**
sl@0
   873
	The event handler for the controller plugin.
sl@0
   874
	*/
sl@0
   875
	MAsyncEventHandler* iAsyncEventHandler;
sl@0
   876
sl@0
   877
	/**
sl@0
   878
	The MMF object container.
sl@0
   879
	*/
sl@0
   880
	CMMFObjectContainer* iMMFObjectContainer;
sl@0
   881
sl@0
   882
	/**
sl@0
   883
	The custom command parser manager.
sl@0
   884
	*/
sl@0
   885
	CMMFCustomCommandParserManager* iCustomCommandParserManager;
sl@0
   886
	};
sl@0
   887
sl@0
   888
sl@0
   889
sl@0
   890
/**
sl@0
   891
@publishedAll
sl@0
   892
@released
sl@0
   893
sl@0
   894
Mixin class that the user of the class CMMFControllerEventMonitor must derive from.
sl@0
   895
sl@0
   896
@since  7.0s
sl@0
   897
*/
sl@0
   898
class MMMFControllerEventMonitorObserver
sl@0
   899
	{
sl@0
   900
public:
sl@0
   901
sl@0
   902
	/**
sl@0
   903
	Handles an event that has been generated.
sl@0
   904
sl@0
   905
	@param  aEvent
sl@0
   906
	        The event to be handled.
sl@0
   907
sl@0
   908
	@since  7.0s
sl@0
   909
	*/
sl@0
   910
	virtual void HandleEvent(const TMMFEvent& aEvent) = 0;
sl@0
   911
	};
sl@0
   912
sl@0
   913
/**
sl@0
   914
@publishedAll
sl@0
   915
@released
sl@0
   916
sl@0
   917
Active object utility class that can be used to monitor a controller plugin for events.
sl@0
   918
If an event occurs, the client will be notified via the MMMFControllerEventMonitorObserver interface.
sl@0
   919
sl@0
   920
@since 7.0s
sl@0
   921
*/
sl@0
   922
class CMMFControllerEventMonitor : public CActive
sl@0
   923
	{
sl@0
   924
public:
sl@0
   925
sl@0
   926
	/**
sl@0
   927
	Constructs a controller event monitor object.
sl@0
   928
sl@0
   929
	@param  aObserver
sl@0
   930
	        A reference to the observer of the active object.  The observer will be
sl@0
   931
	        notified when an event occurs.
sl@0
   932
	@param  aMMFController
sl@0
   933
	        A reference to the client controller interface class.
sl@0
   934
sl@0
   935
	@return A pointer to the new event monitor.
sl@0
   936
sl@0
   937
	@since  7.0s
sl@0
   938
	*/
sl@0
   939
	IMPORT_C static CMMFControllerEventMonitor* NewL(MMMFControllerEventMonitorObserver& aObserver,
sl@0
   940
		RMMFController& aMMFController);
sl@0
   941
	/**
sl@0
   942
	Destructor.
sl@0
   943
	*/
sl@0
   944
	~CMMFControllerEventMonitor();
sl@0
   945
sl@0
   946
	/**
sl@0
   947
	Tells the controller event monitor to start listening for events.
sl@0
   948
sl@0
   949
	The controller plugin must have been opened before this method is called.
sl@0
   950
sl@0
   951
	@since  7.0s
sl@0
   952
	*/
sl@0
   953
	IMPORT_C void Start();
sl@0
   954
sl@0
   955
private:
sl@0
   956
	/**
sl@0
   957
	Calls HandleEvent on iObserver.
sl@0
   958
sl@0
   959
	This will not leave.
sl@0
   960
sl@0
   961
	@since  7.0s
sl@0
   962
	*/
sl@0
   963
	void RunL();
sl@0
   964
sl@0
   965
	/**
sl@0
   966
	Cancels the outstanding request on iMMFController.
sl@0
   967
sl@0
   968
	@since  7.0s
sl@0
   969
	*/
sl@0
   970
	void DoCancel();
sl@0
   971
sl@0
   972
	/**
sl@0
   973
	Constructs a controller event monitor object.
sl@0
   974
	
sl@0
   975
	@param  aObserver
sl@0
   976
	        A reference to the observer of the active object.  The observer will be
sl@0
   977
	        notified when an event occurs.
sl@0
   978
	@param  aMMFController
sl@0
   979
	        A reference to the client controller interface class.
sl@0
   980
sl@0
   981
	@since  7.0s
sl@0
   982
	*/
sl@0
   983
	CMMFControllerEventMonitor(MMMFControllerEventMonitorObserver& aObserver,
sl@0
   984
		RMMFController& aMMFController);
sl@0
   985
private:
sl@0
   986
	MMMFControllerEventMonitorObserver& iObserver;
sl@0
   987
	RMMFController& iMMFController;
sl@0
   988
	TMMFEventPckg iEventPckg;
sl@0
   989
	};
sl@0
   990
sl@0
   991
/**
sl@0
   992
Mixin class that the user of the class CMMFAddDataSourceSinkAsync must derive from.
sl@0
   993
@since 8.0
sl@0
   994
@publishedAll
sl@0
   995
@released
sl@0
   996
*/
sl@0
   997
class MMMFAddDataSourceSinkAsyncObserver
sl@0
   998
	{
sl@0
   999
public:
sl@0
  1000
/**
sl@0
  1001
The request to add a data source or sink has completed.
sl@0
  1002
@param	"aError"		"The error resulting from adding the source/sink."
sl@0
  1003
@param  "aHandleInfo"	"This object identifies	the data source/sink inside the controller 
sl@0
  1004
						framework.  This allows the client to send custom commands directly to 
sl@0
  1005
						the data source/sink, and to also remove the data sink from the controller.
sl@0
  1006
						Note that not all data sinks support custom commands, and not all
sl@0
  1007
						controller plugins support the removal of a data sink."
sl@0
  1008
*/
sl@0
  1009
	virtual void MadssaoAddDataSourceSinkAsyncComplete(TInt aError, const TMMFMessageDestination& aHandle) = 0;
sl@0
  1010
	};
sl@0
  1011
sl@0
  1012
sl@0
  1013
/**
sl@0
  1014
Active object utility class that can be used to add a data source or data sink to a controller
sl@0
  1015
plugin asynchronously.  Once the command has been completed, the caller will be notified via the
sl@0
  1016
MMMFAddDataSourceSinkAsyncObserver interface.
sl@0
  1017
@since 8.0
sl@0
  1018
@publishedAll
sl@0
  1019
@released
sl@0
  1020
sl@0
  1021
*/
sl@0
  1022
class CMMFAddDataSourceSinkAsync : public CActive
sl@0
  1023
	{
sl@0
  1024
public:
sl@0
  1025
sl@0
  1026
	IMPORT_C static CMMFAddDataSourceSinkAsync* NewL(MMMFAddDataSourceSinkAsyncObserver& aObs);
sl@0
  1027
    IMPORT_C void AddDataSource(RMMFController& aController, TUid aSourceUid, const TDesC8& aSourceInitData);
sl@0
  1028
	IMPORT_C void AddFileHandleDataSource(RMMFController& aController, const RFile& aFile);
sl@0
  1029
	IMPORT_C void AddFileHandleDataSource(RMMFController& aController, const RFile& aFile, const TDesC8& aSourceInitData);
sl@0
  1030
    IMPORT_C void AddDataSink(RMMFController& aController, TUid aSinkUid, const TDesC8& aSinkInitData);
sl@0
  1031
	IMPORT_C void AddFileHandleDataSink(RMMFController& aController, const RFile& aFile);
sl@0
  1032
	IMPORT_C void AddFileHandleDataSink(RMMFController& aController, const RFile& aFile, const TDesC8& aSinkInitData);
sl@0
  1033
sl@0
  1034
	~CMMFAddDataSourceSinkAsync();
sl@0
  1035
sl@0
  1036
private:
sl@0
  1037
	void RunL();
sl@0
  1038
	void DoCancel();
sl@0
  1039
	CMMFAddDataSourceSinkAsync(MMMFAddDataSourceSinkAsyncObserver& aObserver);
sl@0
  1040
private:
sl@0
  1041
	enum TCurrentAction {EIdle, EAddingDataSource, EAddingDataSink};
sl@0
  1042
private:
sl@0
  1043
	MMMFAddDataSourceSinkAsyncObserver& iObserver;
sl@0
  1044
	TMMFMessageDestinationPckg iHandleInfoPckg;
sl@0
  1045
	TCurrentAction iCurrentAction;
sl@0
  1046
	RMMFController* iMMFController;
sl@0
  1047
	HBufC8* iSourceSinkInitData;
sl@0
  1048
	TMMFUidPckg iSourceSinkUidPckg;
sl@0
  1049
	};
sl@0
  1050
sl@0
  1051
#endif