1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 #ifndef __MMFCONTROLLER_H__
18 #define __MMFCONTROLLER_H__
20 #include <mmf/server/mmfdatasource.h>
21 #include <mmf/server/mmfdatasink.h>
22 #include <mmf/common/mmfcontrollerframework.h>
23 #include <mmf/common/mmfcontrollerpluginresolver.h>
24 #include <mmf/plugin/mmfplugininterfaceuids.hrh>
33 Error category denoting a general controller error.
38 const TUid KMMFErrorCategoryControllerGeneralError = {0x101F76D3};
44 Error category denoting playback complete i.e. due to EOF or error condition
49 const TUid KMMFEventCategoryPlaybackComplete = {0x101f7ea0};
55 Client representation of a controller plugin for the Multimedia Framework.
57 This class allows a client to load a controller plugin into a new thread and access the
58 functionality provided by that plugin.
66 IMPORT_C RMMFController();
68 IMPORT_C TInt Open(TUid aControllerUid, const TMMFPrioritySettings& aPrioritySettings);
70 IMPORT_C TInt Open(const CMMFControllerImplementationInformation& aControllerInfo, const TMMFPrioritySettings& aPrioritySettings);
72 IMPORT_C TInt Open(TUid aControllerUid, const TMMFPrioritySettings& aPrioritySettings, TBool aUseSharedHeap );
74 IMPORT_C TInt Open(const CMMFControllerImplementationInformation& aControllerInfo, const TMMFPrioritySettings& aPrioritySettings, TBool aUseSharedHeap );
76 IMPORT_C TInt OpenInSecureDRMProcess(TUid aControllerUid, const TMMFPrioritySettings& aPrioritySettings);
78 IMPORT_C TInt OpenInSecureDRMProcess(const CMMFControllerImplementationInformation& aControllerInfo, const TMMFPrioritySettings& aPrioritySettings);
80 IMPORT_C TInt OpenInSecureDRMProcess(TUid aControllerUid, const TMMFPrioritySettings& aPrioritySettings, TBool aUseSharedHeap );
82 IMPORT_C TInt OpenInSecureDRMProcess(const CMMFControllerImplementationInformation& aControllerInfo, const TMMFPrioritySettings& aPrioritySettings, TBool aUseSharedHeap );
84 IMPORT_C void Close();
86 IMPORT_C TInt SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings) const;
88 IMPORT_C TInt AddDataSource(TUid aSourceUid, const TDesC8& aSourceInitData);
90 IMPORT_C TInt AddDataSink(TUid aSinkUid, const TDesC8& aSinkInitData);
92 IMPORT_C TInt AddDataSource(TUid aSourceUid, const TDesC8& aSourceInitData, TMMFMessageDestination& aHandleInfo);
94 IMPORT_C TInt AddDataSink(TUid aSinkUid, const TDesC8& aSinkInitData, TMMFMessageDestination& aHandleInfo);
96 IMPORT_C void AddDataSource(const TMMFUidPckg& aSourceUid, const TDesC8& aSourceInitData, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
97 IMPORT_C void AddFileHandleDataSource(const RFile& aFile, const TDesC8& aSourceInitData, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
98 IMPORT_C void AddFileHandleDataSource(const RFile& aFile, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
100 IMPORT_C void CancelAddDataSource();
102 IMPORT_C void AddDataSink(const TMMFUidPckg& aSinkUid, const TDesC8& aSinkInitData, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
103 IMPORT_C void AddFileHandleDataSink(const RFile& aFile, const TDesC8& aSinkInitData, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
104 IMPORT_C void AddFileHandleDataSink(const RFile& aFile, TMMFMessageDestinationPckg& aHandleInfoPckg, TRequestStatus& aStatus);
106 IMPORT_C void CancelAddDataSink();
108 IMPORT_C TInt RemoveDataSource(const TMMFMessageDestination& aSourceHandleInfo);
110 IMPORT_C TInt RemoveDataSink(const TMMFMessageDestination& aSinkHandleInfo);
112 IMPORT_C TInt Reset();
114 IMPORT_C TInt Prime();
116 IMPORT_C TInt Play();
118 IMPORT_C TInt Pause();
120 IMPORT_C TInt Stop();
122 IMPORT_C TInt GetPosition(TTimeIntervalMicroSeconds& aPosition) const;
124 IMPORT_C TInt SetPosition(const TTimeIntervalMicroSeconds& aPosition) const;
126 IMPORT_C TInt GetDuration(TTimeIntervalMicroSeconds& aDuration) const;
128 IMPORT_C TInt GetNumberOfMetaDataEntries(TInt& aNumberOfEntries) const;
130 IMPORT_C CMMFMetaDataEntry* GetMetaDataEntryL(TInt aIndex) const;
132 IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
134 IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
136 IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
138 IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
140 IMPORT_C void ReceiveEvents(TMMFEventPckg& aEventPckg, TRequestStatus& aStatus);
142 IMPORT_C TInt CancelReceiveEvents();
144 IMPORT_C TInt SetThreadPriority(const TThreadPriority& aPriority) const;
148 The controller proxy. Used to pass messages to the controller thread.
150 RMMFControllerProxy iControllerProxy;
153 Used to hold the destination information for messages for the standard controller plugin interface.
155 TMMFMessageDestinationPckg iDestinationPckg;
163 Defines an object to which a client may have a direct handle.
165 This class provides a way of identifying objects within the controller framework, and a means
166 of passing commands to those objects.
170 class CMMFObject : public CBase
172 friend class CMMFObjectContainer;//to set the handle
174 IMPORT_C ~CMMFObject();
176 IMPORT_C CMMFObject(TUid aInterfaceId);
178 IMPORT_C const TMMFMessageDestination& Handle();
180 IMPORT_C TBool operator==(const CMMFObject& aOther);
183 Passes a message to the object to handle.
185 This is a pure virtual method to be implemented by concrete classes derived from this class.
187 The message passed in MUST be completed by the object; however, it can be copied to be
188 completed at a later time, should some other asynchronous action need to occur first.
191 The message to be handled. This MUST be completed by the object.
195 virtual void HandleRequest(TMMFMessage& aMessage) = 0;
197 void SetHandle(const TMMFMessageDestination& aNewHandle);
199 TMMFMessageDestination iHandle;
206 Container class to hold the CMMFObject-derived objects in the controller framework.
210 class CMMFObjectContainer : public CBase
214 IMPORT_C CMMFObjectContainer();
216 IMPORT_C ~CMMFObjectContainer();
218 IMPORT_C TInt AddMMFObject(CMMFObject& aObject);
220 IMPORT_C void RemoveAndDestroyMMFObject(CMMFObject& aObject);
222 IMPORT_C TInt FindMMFObject(const TMMFMessageDestination& aObjectHandle, CMMFObject*& aObjectFound);
224 IMPORT_C void DeleteAllObjects();
226 const RPointerArray<CMMFObject>& MMFObjects();
230 Internal method to find an object in the array.
232 TInt FindMMFObject(const CMMFObject& aObject, TInt& aPositionInArray);
235 Internal method used to generate the object handle for a newly added object.
237 TInt GenerateObjectHandle();
240 The array of objects.
242 RPointerArray<CMMFObject> iObjects;
245 The next available object handle.
247 TInt iNextObjectHandle;
255 CMMFObject-derived class to wrap a Data Source.
257 Allows a handle to be attributed to a data source, so it can be removed from the controller and
258 the client can send messages directly to it.
262 class CMMFDataSourceHolder : public CMMFObject
266 IMPORT_C CMMFDataSourceHolder(MDataSource& aDataSource);
268 IMPORT_C ~CMMFDataSourceHolder();
270 IMPORT_C MDataSource& DataSource();
273 IMPORT_C void HandleRequest(TMMFMessage& aMessage);
276 Pointer to the data source owned by this object.
278 MDataSource* iDataSource;
285 CMMFObject-derived class to wrap a Data Sink.
287 Allows a handle to be attributed to a data sink, so it can be removed from the controller and
288 the client can send messages directly to it.
292 class CMMFDataSinkHolder : public CMMFObject
295 IMPORT_C CMMFDataSinkHolder(MDataSink& aDataSink);
297 IMPORT_C ~CMMFDataSinkHolder();
299 IMPORT_C MDataSink& DataSink();
302 IMPORT_C void HandleRequest(TMMFMessage& aMessage);
306 Pointer to the data sink owned by this object.
308 MDataSink* iDataSink;
316 Base class for client-side custom command classes.
318 In order facilitate the use of the more common custom commands, it is desirable to write
319 a concrete API class for the client to use. This API class can then be use to wrap all the code
320 involved to formulate the custom command messages.
324 class RMMFCustomCommandsBase
328 IMPORT_C RMMFCustomCommandsBase(RMMFController& aController, TUid aInterfaceId);
333 Derived classes should use iController.CustomCommandSync() and
334 iController.CustomCommandAsync() to send the custom commands to the controller
337 RMMFController& iController;
340 The destination package.
342 Derived classes must pass this into iController.CustomCommandSync() and
343 iController.CustomCommandAsync() as the destination argument.
345 TMMFMessageDestinationPckg iDestinationPckg;
352 Base class to define the interface of a custom command parser.
354 In order to facilitate the support of common custom commands by controller plugins, a
355 custom command parser object can be used. A set of custom command parsers are created
356 by the controller plugin (one for each interface supported), and added to the custom command
357 parser manager in the controller framework. The controller plugin must also derive from a set of
358 concrete interfaces (provided in the form of mixin classes). Then, a custom command supported by
359 one of the custom command parsers will appear to the controller as a concrete API call, rather than
360 a call to its own custom command API.
364 class CMMFCustomCommandParserBase : public CBase
369 Pure virtual method to be implemented by derived classes.
371 Derived classes must implement the code to decode the message from the client.
374 The message to be serviced. This message must be completed by the derived class.
378 virtual void HandleRequest(TMMFMessage& aMessage) = 0;
381 Returns the UID of the custom command interface provided by this parser.
383 @return The interface UID.
387 IMPORT_C TUid InterfaceId();
394 IMPORT_C ~CMMFCustomCommandParserBase();
401 The uid of the custom command interface provided by this parser.
402 This must be the same as the interface id of the corresponding client
403 API class. See RMMFCustomCommandsBase.
407 IMPORT_C CMMFCustomCommandParserBase(TUid aInterfaceId);
412 The uid of the custom command interface provided by this parser.
417 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
418 #include <mmf/common/mmfcontrollerextendeddata.h>
419 #include <mmf/common/mmfcustomcommandparsermanager.h>
423 class CMMFControllerExtendedData;
424 class CMMFCustomCommandParserManager;
429 Base class for controller plugins.
431 A controller plugin for the multimedia framework must derive from this class and implement
432 all the pure virtual functions.
434 Controller plugins control the flow of multimedia data from one or more sources to one or
435 more sinks. For example, an audio controller plugin might take data from a file source and
436 output it to a speaker sink, or take data from a microphone source and save it to a file
437 sink. A controller plugin typically supports one or more multimedia formats, for example
442 class CMMFController : public CBase
447 Allocates and constructs a new controller plugin.
449 Uses ECOM to instantiate a new controller plugin. Can leave with any of the system-wide error codes.
451 @param aControllerUid
452 The unique ID of the controller to be instantiated from ECOM.
454 A reference to an event handling object that can be used by the
455 controller to send events back to the client.
457 The thread Id of the client thread
459 @return A pointer to the new controller plugin.
463 static CMMFController* NewL(TUid aControllerUid, MAsyncEventHandler& aEventHandler, TThreadId aClientTid);
466 Handles a message from the client.
468 Decodes the message and calls one of the private DoXxx methods to unpackaged the parameters.
471 The message to be handled.
475 IMPORT_C virtual void HandleRequestL(TMMFMessage& aMessage);
480 IMPORT_C virtual ~CMMFController();
488 // virtual functions to be implemented by controller plugin
491 Add a data source to the controller plugin.
493 NOTE: The data source is owned by the controller framework, NOT by the controller plugin.
494 Under no circumstances should the controller plugin delete the data source.
497 A reference to the data source to be added. The controller plugin
498 may call aDataSource.DataSourceType() to find out
499 exactly what type of source it is.
501 @leave KErrNotSupported
502 If the controller plugin does not support the data source, it should leave with this.
506 virtual void AddDataSourceL(MDataSource& aDataSource) = 0;
509 Adds a data sink to the controller plugin.
511 NOTE: The data sink is owned by the controller framework, NOT by the controller plugin.
512 Under no circumstances should the controller plugin delete the data sink.
515 A reference to the data sink to be added. The controller plugin
516 may call aDatasink.DatasinkType() to find out
517 exactly what type of sink it is.
519 @leave KErrNotSupported
520 If the controller plugin does not support the data sink, it should leave with this.
524 virtual void AddDataSinkL(MDataSink& aDataSink) = 0;
527 Removes a data source from the controller plugin.
530 The data source is owned by the controller framework, NOT by the controller plugin.
531 Under no circumstances should the controller plugin delete the data source.
534 A reference to the data source to be removed.
536 @leave KErrNotSupported
537 The controller plugin may leave during this method. If the controller plugin does
538 not support the removal of data sources, it should leave with
539 KErrNotSupported. If the controller plugin leaves, the data source will
540 not be destroyed by the controller framework. If it does not leave, the data source
545 virtual void RemoveDataSourceL(MDataSource& aDataSource) = 0;
548 Removes a data sink from the controller plugin.
551 The data sink is owned by the controller framework, NOT by the controller plugin.
552 Under no circumstances should the controller plugin delete the data sink.
555 A reference to the data sink to be removed.
557 @leave KErrNotSupported
558 The controller plugin may leave during this method. If the controller plugin does
559 not support the removal of data sinks, it should leave with
560 KErrNotSupported. If the controller plugin leaves, the data sink will
561 not be destroyed by the controller framework. If it does not leave, the data sink
566 virtual void RemoveDataSinkL(MDataSink& aDataSink) = 0;
569 Resets the controller plugin.
571 The controller should revert back to its newly constructed state. If the Reset is successful
572 (i.e. it doesn't leave), the controller framework will delete all objects added to the
573 MMFObjectManager including any sources and sinks.
575 @leave KErrNotSupported
576 If the controller plugin does not support being reset, it should leave with KErrNotSupported.
580 virtual void ResetL() = 0;
583 Primes the controller plugin.
585 The controller must prepare to start playing, by initialising its sources, sinks and buffers.
586 This moves the controller from the STOPPED to the PRIMED state.
590 virtual void PrimeL() = 0;
593 A partner to the PrimeL() method that is overridable to allow Asynchronous
594 completion in the controller whilst maintaining a Synchronous client API.
596 The default implementation of this is to call PrimeL() and complete the message with KErrNone.
600 IMPORT_C virtual void PrimeL(TMMFMessage& aMessage);
605 The controller must now begin transferring data from its source(s) to its sink(s).
606 This moves the controller from the PRIMED to the PLAYING state.
609 This method must return once playing has commenced, and not wait until playing is complete.
613 virtual void PlayL()= 0;
616 A partner to the PlayL() method that is overridable to allow Asynchronous
617 completion in the controller whilst maintaining a Synchronous client API.
619 The default implementation of this is to call PlayL() and complete the message with KErrNone.
623 IMPORT_C virtual void PlayL(TMMFMessage& aMessage);
627 Pauses the controller plugin.
629 The controller must now cease transferring data from its source(s) to its sink(s).
630 This moves the controller from the PLAYING back to the PRIMED state.
632 A subsequent call to Play() will cause the controller plugin to resume playback
633 from the point it was paused (unless there has been a call to SetPosition() in
638 virtual void PauseL()= 0;
641 A partner to the PauseL() method that is overridable to allow Asynchronous
642 completion in the controller whilst maintaining a Synchronous client API.
644 The default implementation of this is to call PauseL() and complete the message with KErrNone.
648 IMPORT_C virtual void PauseL(TMMFMessage& aMessage);
651 Stops the controller plugin.
653 The controller must now undo anything that occurred during the call to Prime().
654 This moves the controller from the PRIMED back to the STOPPED state.
658 virtual void StopL()= 0;
661 A partner to the StopL() method that is overridable to allow Asynchronous
662 completion in the controller whilst maintaining a Synchronous client API.
664 The default implementation of this is to call StopL() and complete the message with KErrNone.
668 IMPORT_C virtual void StopL(TMMFMessage& aMessage);
671 Gets the current position.
673 The controller plugin should calculate the current position in microseconds.
675 @return The current position in microseconds.
679 virtual TTimeIntervalMicroSeconds PositionL() const = 0;
682 Sets the current position.
684 The controller plugin should reposition itself to the position provided.
687 The desired position in microseconds.
691 virtual void SetPositionL(const TTimeIntervalMicroSeconds& aPosition) = 0;
694 Gets the duration of the clip.
696 The controller plugin should calculate the clip duration in microseconds.
698 @return The clips duration in microseconds.
702 virtual TTimeIntervalMicroSeconds DurationL() const = 0;
705 Sets the priority settings.
707 The new priority settings must be applied to any resource being used by the controller
708 plugin that requires priority settings (for example the sound device).
710 @param aPrioritySettings
711 The new priority settings
716 virtual void SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings) = 0;
719 Handles a custom command.
721 Custom commands allow a controller plugin to define its own API. If the controller framework
722 does not understand a message from the client, it is assumed this is a custom command for the
723 plugin and passed into this interface.
725 The more common custom commands can be handled by Custom Command Parsers on behalf of the
726 controller plugin. This allows the controller plugin to implement a concrete interface
727 (defined by mixin classes) rather than having to decode the command itself. For more
728 information, see CMMFCustomCommandParserBase.
730 The controller plugin must always complete the message passed into this method,
731 even if it does not support the interface required by the message.
734 The message to be handled by the controller plugin.
736 @see CMMFCustomCommandParserBase.
739 virtual void CustomCommand(TMMFMessage& aMessage)
740 {aMessage.Complete(KErrNotSupported);};//default implementation
743 RetrieveS the number of meta data entries in the clip.
745 @param aNumberOfEntries
746 The controller plugin must set this to the number of meta data entries
751 virtual void GetNumberOfMetaDataEntriesL(TInt& aNumberOfEntries) = 0;
754 Retrieves a meta data entry from the clip.
757 The index of the meta data entry to retrieve.
759 @return A pointer to a newly created CMMFMetaDataEntry object containing the meta information.
760 The controller framework will take ownership of the object when this method returns.
764 virtual CMMFMetaDataEntry* GetMetaDataEntryL(TInt aIndex) = 0;
766 // Utility functions to be used by controller plugins
769 Sends an event to the client.
771 The controller plugin can use this method to send an event to the client.
774 The event to be sent to the client.
775 @return One of the system-wide error codes.
779 IMPORT_C TInt DoSendEventToClient(const TMMFEvent& aEvent);
782 Gets a reference to the multimedia framework object container.
784 The controller plugin may add CMMFObject-derived objects to the container to allow them
785 to receive messages directly from the client.
787 @return A reference to the MMFObjectContainer.
791 IMPORT_C CMMFObjectContainer& MMFObjectContainerL();
794 Adds a custom command parser to the controller framework.
796 If the controller framework receives a request it does not understand, it will
797 search through its list of custom command parsers before passing the request
798 on to the controller plugin as a custom command.
800 By using the custom command parsers, the controller plugin can implement a concrete
801 API rather than having to decode the common custom commands itself.
804 The parser to be added to the controller framework. The controller framework
805 takes ownership of the parser if the call does not leave.
809 IMPORT_C void AddCustomCommandParserL(CMMFCustomCommandParserBase& aParser);
812 Retrieves the client thread Id of this controller.
814 @return Thread Id of the controller's client
816 IMPORT_C TThreadId ClientThreadIdL();
819 Check the Secure DRM Mode of current controller object
821 @return ETrue if the controller is running under Secure DRM mode; otherwise EFalse.
823 IMPORT_C TBool IsSecureDrmModeL();
827 This is internal and not intended for use.
829 void ConstructL(MAsyncEventHandler& aEventHandler, TThreadId aClientTid);
830 // IPC decode functions
831 TBool DoAddDataSourceL(TMMFMessage& aMessage);
832 TBool DoAddDataSinkL(TMMFMessage& aMessage);
833 TBool DoAddFileHandleDataSourceL(TMMFMessage& aMessage);
834 TBool DoAddFileHandleDataSinkL(TMMFMessage& aMessage);
835 TBool DoRemoveDataSourceL(TMMFMessage& aMessage);
836 TBool DoRemoveDataSinkL(TMMFMessage& aMessage);
837 TBool DoResetL(TMMFMessage& aMessage);
838 TBool DoPrimeL(TMMFMessage& aMessage);
839 TBool DoPlayL(TMMFMessage& aMessage);
840 TBool DoPauseL(TMMFMessage& aMessage);
841 TBool DoStopL(TMMFMessage& aMessage);
842 TBool DoGetPositionL(TMMFMessage& aMessage);
843 TBool DoSetPositionL(TMMFMessage& aMessage);
844 TBool DoGetDurationL(TMMFMessage& aMessage);
845 TBool DoSetPrioritySettingsL(TMMFMessage& aMessage);
846 void DoCustomCommand(TMMFMessage& aMessage);
847 TBool DoGetNumberOfMetaDataEntriesL(TMMFMessage& aMessage);
848 TBool DoGetSizeOfMetaDataEntryL(TMMFMessage& aMessage);
849 TBool DoGetMetaDataEntryL(TMMFMessage& aMessage);
850 TBool DoPreloadSourceSinkInitDataL(TMMFMessage& aMessage);
851 TBool DoAddFileHandleDataSourceWithInitDataL(TMMFMessage& aMessage);
852 TBool DoAddFileHandleDataSinkWithInitDataL(TMMFMessage& aMessage);
853 void ReplaceFileHandleInInitDataL(RFile* aFile, TDes8& aInitData);
854 // Ownership of aSource is taken into this function
855 void AddMDataSourceAndRepondClientL(MDataSource* aSource, TMMFMessage& aMessage);
856 // Ownership of aSink is taken into this function
857 void AddMDataSinkAndRepondClientL(MDataSink* aSink, TMMFMessage& aMessage);
858 CMMFControllerExtendedData* GetExtendedDataL();
859 static CMMFControllerExtendedData* CreateExtendedDataL(TThreadId aClientTid);
863 Buffer to assist copy of meta data over the thread boundary.
865 CBufFlat* iMetaDataBuffer;
873 The event handler for the controller plugin.
875 MAsyncEventHandler* iAsyncEventHandler;
878 The MMF object container.
880 CMMFObjectContainer* iMMFObjectContainer;
883 The custom command parser manager.
885 CMMFCustomCommandParserManager* iCustomCommandParserManager;
894 Mixin class that the user of the class CMMFControllerEventMonitor must derive from.
898 class MMMFControllerEventMonitorObserver
903 Handles an event that has been generated.
906 The event to be handled.
910 virtual void HandleEvent(const TMMFEvent& aEvent) = 0;
917 Active object utility class that can be used to monitor a controller plugin for events.
918 If an event occurs, the client will be notified via the MMMFControllerEventMonitorObserver interface.
922 class CMMFControllerEventMonitor : public CActive
927 Constructs a controller event monitor object.
930 A reference to the observer of the active object. The observer will be
931 notified when an event occurs.
932 @param aMMFController
933 A reference to the client controller interface class.
935 @return A pointer to the new event monitor.
939 IMPORT_C static CMMFControllerEventMonitor* NewL(MMMFControllerEventMonitorObserver& aObserver,
940 RMMFController& aMMFController);
944 ~CMMFControllerEventMonitor();
947 Tells the controller event monitor to start listening for events.
949 The controller plugin must have been opened before this method is called.
953 IMPORT_C void Start();
957 Calls HandleEvent on iObserver.
966 Cancels the outstanding request on iMMFController.
973 Constructs a controller event monitor object.
976 A reference to the observer of the active object. The observer will be
977 notified when an event occurs.
978 @param aMMFController
979 A reference to the client controller interface class.
983 CMMFControllerEventMonitor(MMMFControllerEventMonitorObserver& aObserver,
984 RMMFController& aMMFController);
986 MMMFControllerEventMonitorObserver& iObserver;
987 RMMFController& iMMFController;
988 TMMFEventPckg iEventPckg;
992 Mixin class that the user of the class CMMFAddDataSourceSinkAsync must derive from.
997 class MMMFAddDataSourceSinkAsyncObserver
1001 The request to add a data source or sink has completed.
1002 @param "aError" "The error resulting from adding the source/sink."
1003 @param "aHandleInfo" "This object identifies the data source/sink inside the controller
1004 framework. This allows the client to send custom commands directly to
1005 the data source/sink, and to also remove the data sink from the controller.
1006 Note that not all data sinks support custom commands, and not all
1007 controller plugins support the removal of a data sink."
1009 virtual void MadssaoAddDataSourceSinkAsyncComplete(TInt aError, const TMMFMessageDestination& aHandle) = 0;
1014 Active object utility class that can be used to add a data source or data sink to a controller
1015 plugin asynchronously. Once the command has been completed, the caller will be notified via the
1016 MMMFAddDataSourceSinkAsyncObserver interface.
1022 class CMMFAddDataSourceSinkAsync : public CActive
1026 IMPORT_C static CMMFAddDataSourceSinkAsync* NewL(MMMFAddDataSourceSinkAsyncObserver& aObs);
1027 IMPORT_C void AddDataSource(RMMFController& aController, TUid aSourceUid, const TDesC8& aSourceInitData);
1028 IMPORT_C void AddFileHandleDataSource(RMMFController& aController, const RFile& aFile);
1029 IMPORT_C void AddFileHandleDataSource(RMMFController& aController, const RFile& aFile, const TDesC8& aSourceInitData);
1030 IMPORT_C void AddDataSink(RMMFController& aController, TUid aSinkUid, const TDesC8& aSinkInitData);
1031 IMPORT_C void AddFileHandleDataSink(RMMFController& aController, const RFile& aFile);
1032 IMPORT_C void AddFileHandleDataSink(RMMFController& aController, const RFile& aFile, const TDesC8& aSinkInitData);
1034 ~CMMFAddDataSourceSinkAsync();
1039 CMMFAddDataSourceSinkAsync(MMMFAddDataSourceSinkAsyncObserver& aObserver);
1041 enum TCurrentAction {EIdle, EAddingDataSource, EAddingDataSink};
1043 MMMFAddDataSourceSinkAsyncObserver& iObserver;
1044 TMMFMessageDestinationPckg iHandleInfoPckg;
1045 TCurrentAction iCurrentAction;
1046 RMMFController* iMMFController;
1047 HBufC8* iSourceSinkInitData;
1048 TMMFUidPckg iSourceSinkUidPckg;