epoc32/include/mmf/common/mmfcontroller.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     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
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    19 
    19 
    20 #include <mmf/server/mmfdatasource.h>
    20 #include <mmf/server/mmfdatasource.h>
    21 #include <mmf/server/mmfdatasink.h>
    21 #include <mmf/server/mmfdatasink.h>
    22 #include <mmf/common/mmfcontrollerframework.h>
    22 #include <mmf/common/mmfcontrollerframework.h>
    23 #include <mmf/common/mmfcontrollerpluginresolver.h>
    23 #include <mmf/common/mmfcontrollerpluginresolver.h>
    24 #include <mmfplugininterfaceuids.hrh>
    24 #include <mmf/plugin/mmfplugininterfaceuids.hrh>
    25 
    25 
    26 #include <caf/caf.h>
    26 #include <caf/caf.h>
    27 
    27 
    28 
    28 
    29 /**
    29 /**
    45 
    45 
    46 @see TMMFEvent
    46 @see TMMFEvent
    47 @since 7.0s
    47 @since 7.0s
    48 */
    48 */
    49 const TUid KMMFEventCategoryPlaybackComplete = {0x101f7ea0};
    49 const TUid KMMFEventCategoryPlaybackComplete = {0x101f7ea0};
    50 
       
    51 /**
       
    52 @internalComponent
       
    53 */
       
    54 const TUid KUidInterfaceMMFDataSinkHolder = {0x101F76D4};
       
    55 /**
       
    56 @internalComponent
       
    57 */
       
    58 const TUid KUidInterfaceMMFDataSourceHolder = {0x101F76D5};
       
    59 /**
       
    60 @internalComponent
       
    61 */
       
    62 const TUid KUidMMFControllerExtendedDataHolder = {0x102834AC};
       
    63 
       
    64 /**
       
    65 @internalComponent
       
    66 
       
    67 Create a const TUid with the same values as the controller
       
    68 ECOM plugin interface UID
       
    69 */
       
    70 const TUid KUidInterfaceMMFController = {KMmfUidPluginInterfaceController};
       
    71 
       
    72 /**
       
    73 @internalComponent
       
    74 
       
    75 IPC messages for interface KUidInterfaceMMFController in the controller framework.
       
    76 */
       
    77 enum TMMFControllerMessages
       
    78 	{
       
    79 	EMMFControllerAddDataSource,
       
    80 	EMMFControllerAddDataSink,
       
    81 	EMMFControllerRemoveDataSource,
       
    82 	EMMFControllerRemoveDataSink,
       
    83 	EMMFControllerReset,
       
    84 	EMMFControllerPrime,
       
    85 	EMMFControllerPlay,
       
    86 	EMMFControllerPause,
       
    87 	EMMFControllerStop,
       
    88 	EMMFControllerGetPosition,
       
    89 	EMMFControllerSetPosition,
       
    90 	EMMFControllerGetDuration,
       
    91 	EMMFControllerGetNumberOfMetaDataEntries,
       
    92 	EMMFControllerGetSizeOfMetaDataEntry,//use internally
       
    93 	EMMFControllerGetMetaDataEntry,
       
    94 	EMMFControllerSetPrioritySettings,
       
    95 	EMMFControllerCancelAddDataSource,
       
    96 	EMMFControllerCancelAddDataSink,
       
    97 	EMMFControllerAddFileHandleDataSource,
       
    98 	EMMFControllerAddFileHandleDataSink,
       
    99 	EMMFControllerSourceSinkInitDataPreload,
       
   100 	EMMFControllerAddFileHandleDataSourceWithInitData,
       
   101 	EMMFControllerAddFileHandleDataSinkWithInitData
       
   102 	};
       
   103 
       
   104 
       
   105 
    50 
   106 /**
    51 /**
   107 @publishedAll
    52 @publishedAll
   108 @released
    53 @released
   109 
    54 
   251 private:
   196 private:
   252 	void SetHandle(const TMMFMessageDestination& aNewHandle);
   197 	void SetHandle(const TMMFMessageDestination& aNewHandle);
   253 private:
   198 private:
   254 	TMMFMessageDestination iHandle;
   199 	TMMFMessageDestination iHandle;
   255 	};
   200 	};
   256 
       
   257 
   201 
   258 /**
   202 /**
   259 @publishedAll
   203 @publishedAll
   260 @released
   204 @released
   261 
   205 
   468 	The uid of the custom command interface provided by this parser.
   412 	The uid of the custom command interface provided by this parser.
   469 	*/
   413 	*/
   470 	TUid iInterfaceId;
   414 	TUid iInterfaceId;
   471 	};
   415 	};
   472 
   416 
   473 /**
   417 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
   474 @publishedPartner
   418 #include <mmf/common/mmfcontrollerextendeddata.h>
   475 @released
   419 #include <mmf/common/mmfcustomcommandparsermanager.h>
   476 
   420 #endif
   477 Class to manage custom command parsers.
       
   478 
       
   479 An object of this type is owned by the controller framework to contain all the custom command
       
   480 parsers for the controller plugin.
       
   481 
       
   482 @since 7.0s
       
   483 */
       
   484 class CMMFCustomCommandParserManager : public CBase
       
   485 	{
       
   486 public:
       
   487 	/**
       
   488 	Factory constructor.
       
   489 
       
   490 	@return A pointer to the newly created object.
       
   491 
       
   492 	@since 7.0s
       
   493 	*/
       
   494 	IMPORT_C static CMMFCustomCommandParserManager* NewL();
       
   495 
       
   496 	/**
       
   497 	Destructor.
       
   498 
       
   499 	Deletes all custom command parsers added to the manager.
       
   500 
       
   501 	@since 7.0s
       
   502 	*/
       
   503 	IMPORT_C ~CMMFCustomCommandParserManager();
       
   504 
       
   505 	/**
       
   506 	Attempts to find a custom command parser capable of handling the message.
       
   507 
       
   508 	@param  aMessage
       
   509             The message to be handled.
       
   510 
       
   511 	@return A boolean indicating in the message has been handled. ETrue if the message has been handled, EFalse
       
   512 	        if it has not.
       
   513 
       
   514 	@since 7.0s
       
   515 	*/
       
   516 	IMPORT_C TBool HandleRequest(TMMFMessage& aMessage);
       
   517 
       
   518 	/**
       
   519 	Adds a custom command parser to the manager.  The manager takes ownership of the parser.
       
   520 
       
   521 	Note:
       
   522 	This method will leave if it fails to add the parser. If it does leave, ownership
       
   523 	of the parser will remain with the caller.
       
   524 
       
   525 	@param  aParser
       
   526 	        A reference to the parser to be added to the manager.
       
   527 
       
   528 	@since 7.0s
       
   529 	*/
       
   530 	IMPORT_C void AddCustomCommandParserL(CMMFCustomCommandParserBase& aParser);
       
   531 private:
       
   532 	CMMFCustomCommandParserManager();
       
   533 private:
       
   534 	/**
       
   535 	The array of custom command parsers.
       
   536 	*/
       
   537 	RPointerArray<CMMFCustomCommandParserBase> iParsers;
       
   538 	};
       
   539 
   421 
   540 
   422 
   541 class CMMFControllerExtendedData;
   423 class CMMFControllerExtendedData;
       
   424 class CMMFCustomCommandParserManager;
   542 /**
   425 /**
   543 @publishedAll
   426 @publishedAll
   544 @released
   427 @released
   545 
   428 
   546 Base class for controller plugins.
   429 Base class for controller plugins.
   827 	@param  aPrioritySettings
   710 	@param  aPrioritySettings
   828 	        The new priority settings
   711 	        The new priority settings
   829 
   712 
   830 	@since  7.0s
   713 	@since  7.0s
   831 
   714 
   832 	@capability MultimediaDD
       
   833 	            A process requesting or using this method that has MultimediaDD capability will
       
   834 				always have precedence over a process that does not have MultimediaDD.
       
   835 	*/
   715 	*/
   836 	virtual void SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings) = 0;
   716 	virtual void SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings) = 0;
   837 
   717 
   838 	/**
   718 	/**
   839 	Handles a custom command.
   719 	Handles a custom command.
  1166 	RMMFController* iMMFController;
  1046 	RMMFController* iMMFController;
  1167 	HBufC8* iSourceSinkInitData;
  1047 	HBufC8* iSourceSinkInitData;
  1168 	TMMFUidPckg iSourceSinkUidPckg;
  1048 	TMMFUidPckg iSourceSinkUidPckg;
  1169 	};
  1049 	};
  1170 
  1050 
  1171 /**
       
  1172 @internalComponent
       
  1173 
       
  1174 The controller proxy session.
       
  1175 
       
  1176 Only one session can be connected to a controller proxy server.
       
  1177 
       
  1178 */
       
  1179 NONSHARABLE_CLASS(CMMFControllerExtendedData) : public CMMFObject
       
  1180 	{
       
  1181 public:
       
  1182 	CMMFControllerExtendedData();
       
  1183 	
       
  1184 	~CMMFControllerExtendedData();
       
  1185 	
       
  1186 	// Set/Get the source/sink initialization data used by CMMFController
       
  1187 	// Ownership of aSourceSinkInitData is transferred (NULL pointer is allow)
       
  1188 	// If source/sink initialization data is already set, previous one will be destroyed
       
  1189 	void SetSourceSinkInitData(HBufC8* aSourceSinkInitData);
       
  1190 	HBufC8* SourceSinkInitData() const;
       
  1191 	void ResetSourceSinkInitData();
       
  1192 
       
  1193 	// Set/Get the client thread ID used by CMMFController
       
  1194 	void SetClientThreadId(TThreadId aClientThreadId);
       
  1195 	TThreadId ClientThreadId() const;
       
  1196 	
       
  1197 	// Set/Get the Secure DRM mode of CMMFController
       
  1198 	void SetSecureDrmMode(TBool aSecureDrmMode);
       
  1199 	TBool SecureDrmMode() const;
       
  1200 		
       
  1201 	//from CMMFObject
       
  1202 	void HandleRequest(TMMFMessage& aMessage);
       
  1203 private:
       
  1204 	/**
       
  1205 	Extended data uses by CMMFController: Source/Sink initialization data
       
  1206 	It serves as a temporary storage for Source/Sink initialization
       
  1207 	Client should request the server to use and cleanup this variable ASAP
       
  1208 	once it is being loaded
       
  1209 	*/
       
  1210 	HBufC8*	iSourceSinkInitData;
       
  1211 	
       
  1212 	/**
       
  1213 	Extended data uses by CMMFController: The client thread Id
       
  1214 	*/
       
  1215 	TThreadId iClientThreadId;
       
  1216 	
       
  1217 	/**
       
  1218 	Extended data uses by CMMFController: Controller Scecure DRM Mode
       
  1219 	*/
       
  1220 	TBool iSecureDrmMode;
       
  1221 	};
       
  1222 
       
  1223 #endif
  1051 #endif