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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 #ifndef __MMFCONTROLLERFRAMEWORK_H__
18 #define __MMFCONTROLLERFRAMEWORK_H__
23 #include <mmf/common/mmfutilities.h>
24 #include <mmf/common/mmfcontrollerframeworkbase.h>
25 #include <mmf/common/mmfipc.h>
28 class CMMFControllerImplementationInformation;
31 _LIT(KMMFControllerProxyServerName, "MMFControllerProxyServer-");
36 #define KMMFControllerProxyVersion TVersion(7,1,1)
41 const TInt KMMFControllerProxyMaxHeapSize = 0x1000000;//16MB
46 const TInt KMMFControllerProxyMaxCachedMessages = 10;
51 Signals that the message is destined for the controller proxy
53 const TInt KMMFObjectHandleControllerProxy = -1;
59 Signals that the message is destined for the controller
61 const TInt KMMFObjectHandleController = -2;
67 Null, or invalid, object handle
69 const TInt KMMFObjectHandleNull = 0;
73 The first valid object handle. The MMF Object container will
74 begin iterating from here when generating object handles.
76 const TInt KMMFObjectHandleFirstValid = 1;
81 const TInt KMmfControllerThreadShutdownTimeout = 20000000; // 20 seconds
86 The UID and messages associated with the controller proxy interface.
88 const TUid KUidInterfaceMMFControllerProxy = {0x101F77E7};
93 Struct to allow RMMFController to pass several parameters to new CControllerProxyServer threads.
95 struct TControllerProxyServerParams
98 TBool iUsingSharedHeap;
105 enum TMMFControllerProxyMessages
107 EMMFControllerProxyLoadControllerPluginByUid,
108 EMMFControllerProxyReceiveEvents,
109 EMMFControllerProxyCancelReceiveEvents
117 Describes the destination of a message in the controller framework.
119 The destination is defined by a UID describing the interface and an integer object handle.
120 The controller framework uses this information when it receives a message to decide where
123 The controller plugin and controller proxy use the special constant handles
124 KMMFObjectHandleControllerProxy and KMMFObjectHandleController for
129 class TMMFMessageDestination
136 Assigns a null UID to the interface, and a null handle to the handle.
140 IMPORT_C TMMFMessageDestination();
143 Constructor for sending messages to the controller plugin.
145 Assigns KMMFObjectHandleController to the destination handle.
148 The UID of the interface of this message destination.
152 IMPORT_C TMMFMessageDestination(TUid aInterfaceId);
158 The UID of the interface of this message destination.
159 @param aDestinationHandle
160 The handle of the destination object in the controller framework.
164 IMPORT_C TMMFMessageDestination(TUid aInterfaceId, TInt aDestinationHandle);
170 The TMMFMessageDestination object to be copied.
174 IMPORT_C TMMFMessageDestination(const TMMFMessageDestination& aOther);
177 Returns the UID of the interface of the message destination.
179 @return The interface UID.
183 IMPORT_C TUid InterfaceId() const;
186 Returns the handle of the destination object in the controller framework.
188 @return The destination handle.
192 IMPORT_C TInt DestinationHandle() const;
195 Compares two destinations.
198 The object to be compared with this object.
200 @return A boolean indicating if the objects are the same. ETrue if the objects are the same,
201 EFalse if the objects are different.
205 IMPORT_C TBool operator==(const TMMFMessageDestination& aOther) const;
209 TInt iDestinationHandle;
211 This member is internal and not intended for use.
222 Package buffer for TMMFMessageDestination
224 typedef TPckgBuf<TMMFMessageDestination> TMMFMessageDestinationPckg;
231 Encapsulation of an RMessage or an RMessage2 to provide protection to controller plugins
232 from the changes occurring with secure APIs.
234 Adds required destination information to the message so the controller framework
235 can determine which object the message is for.
237 Adds capability to check whether the message has been completed.
239 Allows two descriptors to be read from the client, and one descriptor to be copied to the client.
241 @see RMMFControllerProxy::SendSync
242 @see RMMFControllerProxy::SendAsync
248 friend class CMMFControllerProxySession;
249 friend class CMMFDevSoundSession;
255 A controller plugin should use this to take a copy of the message when it must wait for some
256 other event before completing it.
259 The message object to copy.
263 IMPORT_C TMMFMessage(const TMMFMessage& aMessage);
266 Returns the destination of the message.
268 @return The destination of the message, consisting of a UID defining the interface and the
269 handle of the destination object.
273 IMPORT_C const TMMFMessageDestination& Destination();
276 Returns an integer describing the function being called. Equivalent to
277 RMessage::Function().
279 @return The function being called over IPC.
281 @see RMessage::Function()
285 IMPORT_C TInt Function();
288 Returns the size of the first descriptor that can be copied over from the client.
290 Use this to create a descriptor of appropriate size before reading the data from the client.
292 @return The size of data 1.
295 IMPORT_C TInt SizeOfData1FromClient();
298 Copy the first descriptor from the client.
301 A descriptor defining the area of memory into which the data from the client
302 will be copied. Note, the descriptor must be of sufficient size.
304 @return One of the system-wide error codes. In particular, KErrBadDescriptor will be returned
305 if the client did not provide a valid descriptor.
309 IMPORT_C TInt ReadData1FromClient(TDes8& aDes);
312 Copy the first descriptor from the client.
314 This functino can leave with one of the system-wide error codes. In particular, the leave code
315 KErrBadDescriptor will be used if the client did not provide a valid descriptor.
318 A descriptor defining the area of memory into which the data from the client
319 will be copied. Note, the descriptor must be of sufficient size.
323 IMPORT_C void ReadData1FromClientL(TDes8& aDes);
327 Returns the size of the second descriptor that can be copied over from the client.
329 Use this to create a descriptor of appropriate size before reading the data from the client.
331 @return The size of data 2.
335 IMPORT_C TInt SizeOfData2FromClient();
338 Copies the second descriptor from the client.
341 A descriptor defining the area of memory into which the data from the client
342 will be copied. Note, the descriptor must be of sufficient size.
344 @return One of the system-wide error codes. In particular, KErrBadDescriptor will be returned
345 if the client did not provide a valid descriptor.
349 IMPORT_C TInt ReadData2FromClient(TDes8& aDes);
352 Copies the second descriptor from the client.
354 This function can leave with one of the system-wide error codes. In particular, the leave code
355 KErrBadDescriptor will be used if the client did not provide a valid descriptor.
358 A descriptor defining the area of memory into which the data from the client
359 will be copied. Note, the descriptor must be of sufficient size.
363 IMPORT_C void ReadData2FromClientL(TDes8& aDes);
366 Copies data back to the client.
369 The data to be copied back to the client. Note that the client must
370 have already created a descriptor of sufficient size for the data to be
373 @return One of the system-wide error codes. In particular, the error code KErrBadDescriptor will
374 be returned if the client did not provide a valid descriptor.
378 IMPORT_C TInt WriteDataToClient(const TDesC8& aDes);
381 Copies the data back to the client.
383 This function can leave with one of the system-wide error codes. In particular, the leave code
384 KErrBadDescriptor will be used if the client did not provide a valid descriptor.
387 The data to be copied back to the client. Note that the client must have already
388 created a descriptor of sufficient size for the data to be copied into.
392 IMPORT_C void WriteDataToClientL(const TDesC8& aDes);
395 Signals to the client that its request has been completed.
397 Equivalent to RMessage::Complete.
400 The result code to be given back to the client.
404 IMPORT_C void Complete(TInt aReason);
406 IMPORT_C void AdoptFileHandleFromClientL(TInt aFsHandleIndex, TInt aFileHandleIndex, RFile& aFile);
409 Checks whether this message has already been completed.
411 @return A boolean indicating if the message has been completed. ETrue if the message has been
412 completed, EFalse if not.
416 IMPORT_C TBool IsCompleted();
419 Constructs a TMMFMessage from an RMmfIpcMessage.
422 The handle to the remote message.
426 IMPORT_C TMMFMessage(const RMmfIpcMessage& aMessage);
429 Gets the destination info from the client.
433 IMPORT_C void FetchDestinationL();
435 #ifdef __MMF_USE_IPC_V2__
437 The encapsulated message
439 RMessagePtr2 iMessage;
441 The encapsulated function
445 Private padding to preserve BC with earlier versions
447 TInt iDummyPadding[6];
450 The RMessage encapsulated by this object.
453 #endif // __MMF_USE_IPC_V2__
456 The destination of this message.
458 TMMFMessageDestination iDestination;
461 Defines whether this object has yet to be completed.
469 Mixin class used by CLogonMonitor to inform about its state
473 class MLogonMonitorObserver
477 The monitored thread has been terminated.
479 virtual void ThreadTerminated() = 0;
485 RSessionBase-based client class to handle the creation of the controller thread and
486 message sending over IPC.
488 The controller proxy is responsible for sending and recieving messages over IPC; it does not
489 care exactly what those messages are.
491 Note the fact that, although this is an internal component, its size cannot be changed because
492 it's embedded in a publishedAll class (RMMFController) and the size of the latter would also be
493 changed raising a binary compatibility problem.
497 NONSHARABLE_CLASS(RMMFControllerProxy) : public RMmfSessionBase, public MLogonMonitorObserver
505 IMPORT_C RMMFControllerProxy();
508 Create a new thread and load a controller plugin into that thread.
510 @param aControllerUid
511 The UID of the controller plugin to be loaded.
512 @param aUseSharedHeap
513 If this value is EFalse each controller is created with its own heap. The alternative,
514 if the value is ETrue, is that controllers share a special heap with other controllers
515 created the same way. Each heap uses a chunk, so this avoids situations where the
516 number of chunks per process is limited. The default behaviour is generally to be
517 preferred, and should give lower overall memory usage. However, if many controllers are
518 to be created for a particular thread, then ETrue should be provided to prevent running
519 out of heaps or chunks.
521 @return One of the system-wide error codes.
524 IMPORT_C TInt LoadController(TUid aControllerUid, TBool aUseSharedHeap);
527 Create a new thread and load a controller plugin into that thread.
529 @param aControllerInfo
530 A reference to a CMMFControllerImplementationInformation object
531 used for determining the controller UID and heap size
532 @param aUseSharedHeap
533 If this value is EFalse each controller is created with its own heap. The alternative,
534 if the value is ETrue, is that controllers share a special heap with other controllers
535 created the same way. Each heap uses a chunk, so this avoids situations where the
536 number of chunks per process is limited. The default behaviour is generally to be
537 preferred, and should give lower overall memory usage. However, if many controllers are
538 to be created for a particular thread, then ETrue should be provided to prevent running
539 out of heaps or chunks.
541 @return One of the system-wide error codes.
544 IMPORT_C TInt LoadController(const CMMFControllerImplementationInformation& aControllerInfo, TBool aUseSharedHeap);
547 Create a new thread in another process through Secure DRM Plugin server and load a controller plugin
548 into that thread. The motivation of this model is to allow applications without DRM capability able
549 to play protected content through MMF.
551 @param aControllerUid
552 The UID of the controller plugin to be loaded.
553 @param aUseSharedHeap
554 If this value is EFalse each controller is created with its own heap. The alternative,
555 if the value is ETrue, is that controllers share a special heap with other controllers
556 created the same way. Each heap uses a chunk, so this avoids situations where the
557 number of chunks per process is limited. The default behaviour is generally to be
558 preferred, and should give lower overall memory usage. However, if many controllers are
559 to be created for a particular thread, then ETrue should be provided to prevent running
560 out of heaps or chunks.
562 @return One of the system-wide error codes.
564 IMPORT_C TInt LoadControllerInSecureDRMProcess(TUid aControllerUid, TBool aUseSharedHeap);
567 Create a new thread in another process through Secure DRM Plugin server and load a controller plugin
568 into that thread. The motivation of this model is to allow applications without DRM capability able
569 to play protected content through MMF.
571 @param aControllerInfo
572 A reference to a CMMFControllerImplementationInformation object
573 used for determining the controller UID and heap size
574 @param aUseSharedHeap
575 If this value is EFalse each controller is created with its own heap. The alternative,
576 if the value is ETrue, is that controllers share a special heap with other controllers
577 created the same way. Each heap uses a chunk, so this avoids situations where the
578 number of chunks per process is limited. The default behaviour is generally to be
579 preferred, and should give lower overall memory usage. However, if many controllers are
580 to be created for a particular thread, then ETrue should be provided to prevent running
581 out of heaps or chunks.
583 @return One of the system-wide error codes.
585 IMPORT_C TInt LoadControllerInSecureDRMProcess(const CMMFControllerImplementationInformation& aControllerInfo, TBool aUseSharedHeap);
588 Delete the controller plugin and close its thread.
590 Clients must call Close() on the controller proxy, otherwise leaks will occur.
594 IMPORT_C void Close();
597 Send a message synchronously to the controller thread.
599 The controller framework will analyze the message to determine its correct destination.
601 Note: This method will not return until the controller framework has serviced the command.
604 The destination of the message, consisting of the uid of
605 the interface of this message.
607 The function number to indicate which function is to be called
608 on the interface defined in the aDestination parameter.
610 A reference to the first chunk of data to be copied to the controller
611 framework. The exact contents of the data are dependent on the
612 interface being called. Can be NULL.
614 A reference to the second chunk of data to be copied to the controller
615 framework. The exact contents of the data are dependent on the
616 interface being called. Can be NULL.
618 A reference to an area of memory to which the controller framework will
619 write any data to be passed back to the client. Can't be NULL.
621 @return The result of the request. Exact range of values is dependent on the interface.
624 IMPORT_C TInt SendSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom) const;
627 Send a message synchronously to the controller thread.
629 The controller framework will analyze the message to determine its correct destination.
631 Note: This method will not return until the controller framework has serviced the command.
634 The destination of the message, consisting of the uid of
635 the interface of this message.
637 The function number to indicate which function is to be called
638 on the interface defined in the aDestination parameter.
640 A reference to the first chunk of data to be copied to the controller
641 framework. The exact contents of the data are dependent on the
642 interface being called. Can be NULL.
644 A reference to the second chunk of data to be copied to the controller
645 framework. The exact contents of the data are dependent on the
646 interface being called. Can be NULL.
648 @return The result of the request. Exact range of values is dependent on the interface.
651 IMPORT_C TInt SendSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2) const;
654 Send a message asynchronously to the controller thread.
656 The controller framework will analyze the message to determine its correct destination.
658 Note: This method will return immediately. The RunL of the active object owning the
659 aStatus parameter will be called when the command is completed by the
660 controller framework.
663 The destination of the message, consisting of the uid of
664 the interface of this message.
666 The function number to indicate which function is to be called
667 on the interface defined in the aDestination parameter.
669 A reference to the first chunk of data to be copied to the controller
670 framework. The exact contents of the data are dependent on the
671 interface being called. Can be NULL.
673 A reference to the second chunk of data to be copied to the controller
674 framework. The exact contents of the data are dependent on the
675 interface being called. Can be NULL.
677 A reference to an area of memory to which the controller framework will
678 write any data to be passed back to the client. Can't be NULL.
680 The TRequestStatus of an active object. This will contain the
681 result of the request on completion. The exact range of
682 result values is dependent on the interface.
686 IMPORT_C void SendAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus) const;
689 Send a message asynchronously to the controller thread.
691 The controller framework will analyze the message to determine its correct destination.
693 Note: This method will return immediately. The RunL of the active object owning the
694 aStatus parameter will be called when the command is completed by the
695 controller framework.
698 The destination of the message, consisting of the uid of
699 the interface of this message.
701 The function number to indicate which function is to be called
702 on the interface defined in the aDestination parameter.
704 A reference to the first chunk of data to be copied to the controller
705 framework. The exact contents of the data are dependent on the
706 interface being called. Can be NULL.
708 A reference to the second chunk of data to be copied to the controller
709 framework. The exact contents of the data are dependent on the
710 interface being called. Can be NULL.
712 The TRequestStatus of an active object. This will contain the
713 result of the request on completion. The exact range of
714 result values is dependent on the interface.
718 IMPORT_C void SendAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus) const;
720 IMPORT_C TInt SendSync(TInt aFunction, const TIpcArgs& aIpcArgs) const;
721 IMPORT_C void SendAsync(TInt aFunction, const TIpcArgs& aIpcArgs, TRequestStatus& aStatus) const;
723 Register to receive events from the controller framework.
725 Events can be generated at any time, and are generally associated with things that occur
726 due to something happening internally within the controller. For example, an event will
727 be generated if the controller stops playing due to reaching the end of a file.
730 A reference to a TMMFEventPckg object that must be member data
731 of the active object calling this method. The details of the event
732 will be copied into this object when an event occurs.
734 The TRequestStatus of the active object calling this method.
737 @see CMMFControllerEventMonitor
740 IMPORT_C void ReceiveEvents(TMMFEventPckg& aEvent, TRequestStatus& aStatus);
743 Cancel a previous registration to receive events from the controller framework.
745 This must be called from the DoCancel() method of the active object using the
748 @return One of the standard system-wide error codes.
753 IMPORT_C TInt CancelReceiveEvents();
756 Set the priority of the controller's sub thread.
758 This can be used to increase the responsiveness of the audio plugin to minimise
759 any lag in processing. This function should be used with care as it may have knock-on
760 effects elsewhere in the system.
763 The TThreadPriority that the thread should run under. The default is EPriorityNormal.
765 A standard error code: KErrNone if successful, KErrNotReady if the thread does not have a
768 IMPORT_C TInt SetThreadPriority(const TThreadPriority& aPriority) const;
771 The controller subthread has been terminated.
773 This is called by CLogonMonitor when the the thread terminates
775 void ThreadTerminated();
778 Creates the new thread
780 TInt DoCreateSubThread(RServer2* aServer2, TUint aMaxHeapSize, TBool aUseSharedHeap);
783 Determines the maximum heap size required by the selected controller
785 TUint ControllersMaxHeapSizeL(TUid aControllerUid);
788 Load a controller by UID
790 @param aControllerUid
791 The UID of the controller plugin to be loaded.
792 @param aControllerInfo
793 A reference to a CMMFControllerImplementationInformation object
794 used for determining the heap size and DRM server supporting state.
795 @param aUseSharedHeap
796 If this value is EFalse each controller is created with its own heap. The alternative,
797 if the value is ETrue, is that controllers share a special heap with other controllers
798 created the same way. Each heap uses a chunk, so this avoids situations where the
799 number of chunks per process is limited. The default behaviour is generally to be
800 preferred, and should give lower overall memory usage. However, if many controllers are
801 to be created for a particular thread, then ETrue should be provided to prevent running
802 out of heaps or chunks.
804 The indicator supplied from user used to determine whether the user's process has DRM
807 One of the system-wide error codes.
809 TInt LoadController(TUid aControllerUid, const CMMFControllerImplementationInformation& aControllerInfo, TBool aUseSharedHeap,
810 TBool aNoDRMCap = EFalse);
813 Release heap - for use when a shared heap has been registered
818 Create a session to handle situation of playing DRM protected content in
819 process with no DRM capability.
820 DRM server process will be created, if not yet created. This server is responsible to
821 manage and monitor all the MMF Controller servers created as seperate threads belong to
822 DRM server process. Once the new MMF Controller server is running, a MMF Controller server
823 session will be created and the handle is passing back.
825 TInt DoCreateSessionForNoDRMCapClient(TUint aMaxHeapSize, TBool aUseSharedHeap);
831 Shared heap has been opened for this object, and must be closed
833 EFlagOpenedSharedHeap=0x01
838 The thread in which the controller plugin will run.
842 Used to hold destination for messages from the controller proxy
843 (not from clients calling SendSync/SendAsync!!)
845 TMMFMessageDestinationPckg iDestinationPckg;
847 Used to determine the success of a logon. If the status is not pending, the logon has failed
848 and the thread should be closed.
850 CLogonMonitor* iLogonAO;
852 The priority at which the controller plugin thread runs.
854 TThreadPriority iThreadPriority;
860 This member is internal and not intended for use.
868 Used to Kill the controller thread either immediately or after a timeout.
869 Used by the controller thread on startup to prevent orphaning if no sessions are created to it.
871 class CMMFControllerProxyShutdown : public CTimer
873 enum {EMMFControllerProxyShutdownDelay=1000000}; // 1s
877 Create a new shutdown timer.
879 This method can leave with one of the system-wide error codes.
883 static CMMFControllerProxyShutdown* NewL();
886 Start the shutdown timer. The RunL of this active object will be called after
887 EMMFControllerProxyShutdownDelay microseconds.
894 Shut down the controller thread immediately.
896 Calls CActiveScheduler::Stop().
902 CMMFControllerProxyShutdown();
918 Mixin class to define an object capable of handling an event within the controller framework.
920 class MAsyncEventHandler
925 Sends an event to the client.
932 virtual TInt SendEventToClient(const TMMFEvent& aEvent) = 0;
938 Used to hold on to an TMMFMessage so we can complete it asynchronously to
939 send an event to the client.
943 class CMMFEventReceiver : public CBase
948 Constructs a new event receiver.
950 This method may leave with one of the system-wide error codes.
953 The message to be completed when an event occurs.
955 @return A pointer to the newly created event receiver.
959 static CMMFEventReceiver* NewL(const TMMFMessage& aMessage);
964 Completes the message with KErrCancel if the message hasn't already been completed.
968 ~CMMFEventReceiver();
971 Sends an event to the client.
978 void SendEvent(const TMMFEvent& aEvent);
985 The message to be completed when an event occurs.
989 CMMFEventReceiver(const TMMFMessage& aMessage);
992 The message to be completed when an event occurs.
994 TMMFMessage iMessage;
1002 The controller proxy server.
1004 The main server inside the controller thread, responsible for creating and destroying the single
1005 session used to transmit messages from the client to the server.
1007 Every controller plugin runs in its own thread, and has its own controller proxy server.
1011 class CMMFControllerProxyServer : public CMmfIpcServer
1015 Construct the server.
1017 This method may leave with one of the system-wide error codes.
1019 @return The newly created server.
1023 static CMMFControllerProxyServer* NewL(RServer2* aServer2 );
1030 ~CMMFControllerProxyServer();
1033 Static thread function.
1035 The address of this function is passed into RThread::Create.
1037 Unpackages the startup parameters and calls DoStartThreadL().
1040 A pointer to the packaged startup parameters.
1042 @return One of the system-wide error codes.
1046 IMPORT_C static TInt StartThread(TAny* aParam);
1049 Called by the active scheduler when the ServiceL of the session leaves.
1050 Completes the message with the error and restarts the server.
1053 The error that the session ServiceL left with.
1058 TInt RunError(TInt aError);
1061 Signals that the session has been created.
1063 Stops the shutdown timer.
1067 void SessionCreated();
1070 Signals that the session has been destroyed.
1071 Causes the server to shut down immediately.
1075 void SessionDestroyed();
1079 Thread startup code.
1081 Creates the cleanup stack, installs the active scheduler and creates the server.
1082 Once all this is completed successfully, it signals the success back to the client.
1084 This function may leave with one of the system-wide error codes.
1087 Used to signal startup success back to the client.
1091 static void DoStartThreadL(TAny* aParam);
1094 Creates a new session. Only one session may be created with the ControllerProxyServer.
1096 This function may leave with one of the system-wide error codes.
1099 The version number of the session.
1101 @return A pointer to the new session.
1105 CMmfIpcSession* NewSessionL(const TVersion& aVersion) const;
1112 CMMFControllerProxyServer();
1115 Second phase constructor.
1119 void ConstructL(RServer2* aServer2);
1122 Renaming Controller Proxy Server name
1126 static void RenameControllerProxyThread();
1130 The timer used to shut down the server in case the client fails to connect a session.
1132 CMMFControllerProxyShutdown* iShutdownTimer;
1134 Indicates whether we have a session connected. Only one session is allowed to connect to the server.
1139 class CMMFController;
1144 The controller proxy session.
1146 Only one session can be connected to a controller proxy server.
1150 class CMMFControllerProxySession : public CMmfIpcSession, public MAsyncEventHandler
1155 Construct the session.
1157 This method may leave with one of the system-wide error codes.
1159 @return The newly created server.
1163 static CMMFControllerProxySession* NewL();
1166 Second phase constructor called by the CServer base class.
1168 This function may leave with one of the system-wide error codes.
1171 A reference to the server to which this session is attached.
1175 void CreateL(const CMmfIpcServer& aServer);
1180 ~CMMFControllerProxySession();
1183 Called by the CServer baseclass when a request has been made by the client.
1185 This function may leave with on of the system-wide error codes. If
1186 a leave occurs, the message will be automatically completed by the
1187 RunError() of the Controller Proxy Server.
1190 The request to be handled. The controller proxy session will create
1191 a TMMFMessage from this, and pass on the request to the controller
1192 base class to handle.
1196 void ServiceL(const RMmfIpcMessage& aMessage);
1199 Derived from MAsyncEventHandler.
1201 @see MAsyncEventHandler
1205 TInt SendEventToClient(const TMMFEvent& aEvent);
1210 CMMFControllerProxySession();
1213 Handle a request from the client to register to receive events from the controller framework.
1215 This function may leave with one of the system-wide error codes.
1218 The request to be handled.
1220 @return ETrue if the message is to be completed now, EFalse if the message will be completed
1223 TBool ReceiveEventsL(TMMFMessage& aMessage);
1226 Handle a request from the client to stop receiving events from the controller framework.
1228 This function may leave with one of the system-wide error codes.
1231 The request to be handled.
1233 @return ETrue if the message is to be completed now, EFalse if the message will be completed later.
1235 TBool CancelReceiveEvents(TMMFMessage& aMessage);
1238 Handle a request from the client to load a controller plugin.
1240 This function may leave with one of the system-wide error codes.
1243 The request to be handled.
1245 @return ETrue if the message is to be completed now, EFalse if the message will be completed later.
1247 TBool LoadControllerL(TMMFMessage& aMessage);
1250 The controller plugin.
1252 CMMFController* iController;
1254 A pointer to the server.
1256 CMMFControllerProxyServer* iServer;
1258 The event receiver. Used to send events to the client.
1260 CMMFEventReceiver* iEventReceiver;
1262 The events waiting to be sent to the client.
1264 RArray<TMMFEvent> iEvents;