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