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