1.1 --- a/epoc32/include/mmf/common/mmfcontrollerframework.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/mmf/common/mmfcontrollerframework.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,9 +1,9 @@
1.4 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 // All rights reserved.
1.6 // This component and the accompanying materials are made available
1.7 -// 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
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 // which accompanies this distribution, and is available
1.10 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.12 //
1.13 // Initial Contributors:
1.14 // Nokia Corporation - initial contribution.
1.15 @@ -31,28 +31,6 @@
1.16 _LIT(KMMFControllerProxyServerName, "MMFControllerProxyServer-");
1.17
1.18 /**
1.19 -@internalComponent
1.20 -*/
1.21 -#define KMMFControllerProxyVersion TVersion(7,1,1)
1.22 -
1.23 -/**
1.24 -@internalComponent
1.25 -*/
1.26 -const TInt KMMFControllerProxyMaxHeapSize = 0x1000000;//16MB
1.27 -
1.28 -/**
1.29 -@internalComponent
1.30 -*/
1.31 -const TInt KMMFControllerProxyMaxCachedMessages = 10;
1.32 -
1.33 -/**
1.34 -@internalComponent
1.35 -
1.36 -Signals that the message is destined for the controller proxy
1.37 -*/
1.38 -const TInt KMMFObjectHandleControllerProxy = -1;
1.39 -
1.40 -/**
1.41 @publishedAll
1.42 @released
1.43
1.44 @@ -67,48 +45,6 @@
1.45 Null, or invalid, object handle
1.46 */
1.47 const TInt KMMFObjectHandleNull = 0;
1.48 -/**
1.49 -@internalComponent
1.50 -
1.51 -The first valid object handle. The MMF Object container will
1.52 -begin iterating from here when generating object handles.
1.53 -*/
1.54 -const TInt KMMFObjectHandleFirstValid = 1;
1.55 -
1.56 -/**
1.57 -@internalComponent
1.58 -*/
1.59 -const TInt KMmfControllerThreadShutdownTimeout = 20000000; // 20 seconds
1.60 -
1.61 -/**
1.62 -@internalComponent
1.63 -
1.64 -The UID and messages associated with the controller proxy interface.
1.65 -*/
1.66 -const TUid KUidInterfaceMMFControllerProxy = {0x101F77E7};
1.67 -
1.68 -/**
1.69 -@internalComponent
1.70 -
1.71 -Struct to allow RMMFController to pass several parameters to new CControllerProxyServer threads.
1.72 -*/
1.73 -struct TControllerProxyServerParams
1.74 - {
1.75 - RServer2* iServer;
1.76 - TBool iUsingSharedHeap;
1.77 - };
1.78 -
1.79 -
1.80 -/**
1.81 -@internalComponent
1.82 -*/
1.83 -enum TMMFControllerProxyMessages
1.84 - {
1.85 - EMMFControllerProxyLoadControllerPluginByUid,
1.86 - EMMFControllerProxyReceiveEvents,
1.87 - EMMFControllerProxyCancelReceiveEvents
1.88 - };
1.89 -
1.90
1.91 /**
1.92 @publishedAll
1.93 @@ -464,7 +400,7 @@
1.94 };
1.95
1.96 /**
1.97 -@internalComponent
1.98 +@publishedAll
1.99
1.100 Mixin class used by CLogonMonitor to inform about its state
1.101
1.102 @@ -480,7 +416,7 @@
1.103 };
1.104
1.105 /**
1.106 -@internalComponent
1.107 +@publishedAll
1.108
1.109 RSessionBase-based client class to handle the creation of the controller thread and
1.110 message sending over IPC.
1.111 @@ -777,7 +713,7 @@
1.112 /**
1.113 Creates the new thread
1.114 */
1.115 - TInt DoCreateSubThread(RServer2* aServer2, TUint aMaxHeapSize, TBool aUseSharedHeap);
1.116 + TInt DoCreateSubThread(RServer2* aServer2, TUint aMaxHeapSize, TBool aUseSharedHeap, TUint aStackSize);
1.117
1.118 /**
1.119 Determines the maximum heap size required by the selected controller
1.120 @@ -822,7 +758,7 @@
1.121 DRM server process. Once the new MMF Controller server is running, a MMF Controller server
1.122 session will be created and the handle is passing back.
1.123 */
1.124 - TInt DoCreateSessionForNoDRMCapClient(TUint aMaxHeapSize, TBool aUseSharedHeap);
1.125 + TInt DoCreateSessionForNoDRMCapClient(TUint aMaxHeapSize, TBool aUseSharedHeap, TUint aStackSize);
1.126
1.127 private:
1.128 enum
1.129 @@ -863,55 +799,6 @@
1.130 };
1.131
1.132 /**
1.133 -@internalComponent
1.134 -
1.135 -Used to Kill the controller thread either immediately or after a timeout.
1.136 -Used by the controller thread on startup to prevent orphaning if no sessions are created to it.
1.137 -*/
1.138 -class CMMFControllerProxyShutdown : public CTimer
1.139 - {
1.140 - enum {EMMFControllerProxyShutdownDelay=1000000}; // 1s
1.141 -public:
1.142 -
1.143 - /**
1.144 - Create a new shutdown timer.
1.145 -
1.146 - This method can leave with one of the system-wide error codes.
1.147 -
1.148 - @since 7.0s
1.149 - */
1.150 - static CMMFControllerProxyShutdown* NewL();
1.151 -
1.152 - /**
1.153 - Start the shutdown timer. The RunL of this active object will be called after
1.154 - EMMFControllerProxyShutdownDelay microseconds.
1.155 -
1.156 - @since 7.0s
1.157 - */
1.158 - void Start();
1.159 -
1.160 - /**
1.161 - Shut down the controller thread immediately.
1.162 -
1.163 - Calls CActiveScheduler::Stop().
1.164 -
1.165 - @since 7.0s
1.166 - */
1.167 - void ShutdownNow();
1.168 -private:
1.169 - CMMFControllerProxyShutdown();
1.170 - void ConstructL();
1.171 -
1.172 - /**
1.173 - Calls ShutdownNow().
1.174 -
1.175 - @since 7.0s
1.176 - */
1.177 - void RunL();
1.178 - };
1.179 -
1.180 -
1.181 -/**
1.182 @publishedAll
1.183 @released
1.184
1.185 @@ -932,337 +819,8 @@
1.186 virtual TInt SendEventToClient(const TMMFEvent& aEvent) = 0;
1.187 };
1.188
1.189 -/**
1.190 -@internalComponent
1.191 -
1.192 -Used to hold on to an TMMFMessage so we can complete it asynchronously to
1.193 -send an event to the client.
1.194 -
1.195 -@since 7.0s
1.196 -*/
1.197 -class CMMFEventReceiver : public CBase
1.198 - {
1.199 -public:
1.200 -
1.201 - /**
1.202 - Constructs a new event receiver.
1.203 -
1.204 - This method may leave with one of the system-wide error codes.
1.205 -
1.206 - @param aMessage
1.207 - The message to be completed when an event occurs.
1.208 -
1.209 - @return A pointer to the newly created event receiver.
1.210 -
1.211 - @since 7.0s
1.212 - */
1.213 - static CMMFEventReceiver* NewL(const TMMFMessage& aMessage);
1.214 -
1.215 - /**
1.216 - Destructor.
1.217 -
1.218 - Completes the message with KErrCancel if the message hasn't already been completed.
1.219 -
1.220 - @since 7.0s
1.221 - */
1.222 - ~CMMFEventReceiver();
1.223 -
1.224 - /**
1.225 - Sends an event to the client.
1.226 -
1.227 - @param aEvent
1.228 - The event.
1.229 -
1.230 - @since 7.0s
1.231 - */
1.232 - void SendEvent(const TMMFEvent& aEvent);
1.233 -private:
1.234 -
1.235 - /**
1.236 - Constructor.
1.237 -
1.238 - @param aMessage
1.239 - The message to be completed when an event occurs.
1.240 -
1.241 - @since 7.0s
1.242 - */
1.243 - CMMFEventReceiver(const TMMFMessage& aMessage);
1.244 -private:
1.245 - /**
1.246 - The message to be completed when an event occurs.
1.247 - */
1.248 - TMMFMessage iMessage;
1.249 - };
1.250 -
1.251 -
1.252 -
1.253 -/**
1.254 -@internalComponent
1.255 -
1.256 -The controller proxy server.
1.257 -
1.258 -The main server inside the controller thread, responsible for creating and destroying the single
1.259 -session used to transmit messages from the client to the server.
1.260 -
1.261 -Every controller plugin runs in its own thread, and has its own controller proxy server.
1.262 -
1.263 -@since 7.0s
1.264 -*/
1.265 -class CMMFControllerProxyServer : public CMmfIpcServer
1.266 - {
1.267 -public:
1.268 - /**
1.269 - Construct the server.
1.270 -
1.271 - This method may leave with one of the system-wide error codes.
1.272 -
1.273 - @return The newly created server.
1.274 -
1.275 - @since 7.0s
1.276 - */
1.277 - static CMMFControllerProxyServer* NewL(RServer2* aServer2 );
1.278 -
1.279 - /**
1.280 - Destructor.
1.281 -
1.282 - @since 7.0s
1.283 - */
1.284 - ~CMMFControllerProxyServer();
1.285 -
1.286 - /**
1.287 - Static thread function.
1.288 -
1.289 - The address of this function is passed into RThread::Create.
1.290 -
1.291 - Unpackages the startup parameters and calls DoStartThreadL().
1.292 -
1.293 - @param aAny
1.294 - A pointer to the packaged startup parameters.
1.295 -
1.296 - @return One of the system-wide error codes.
1.297 -
1.298 - @since 7.0s
1.299 - */
1.300 - IMPORT_C static TInt StartThread(TAny* aParam);
1.301 -
1.302 - /**
1.303 - Called by the active scheduler when the ServiceL of the session leaves.
1.304 - Completes the message with the error and restarts the server.
1.305 -
1.306 - @param aError
1.307 - The error that the session ServiceL left with.
1.308 -
1.309 - @return KErrNone
1.310 - @since 7.0s
1.311 - */
1.312 - TInt RunError(TInt aError);
1.313 -
1.314 - /**
1.315 - Signals that the session has been created.
1.316 -
1.317 - Stops the shutdown timer.
1.318 -
1.319 - @since 7.0s
1.320 - */
1.321 - void SessionCreated();
1.322 -
1.323 - /**
1.324 - Signals that the session has been destroyed.
1.325 - Causes the server to shut down immediately.
1.326 -
1.327 - @since 7.0s
1.328 - */
1.329 - void SessionDestroyed();
1.330 -private:
1.331 -
1.332 - /**
1.333 - Thread startup code.
1.334 -
1.335 - Creates the cleanup stack, installs the active scheduler and creates the server.
1.336 - Once all this is completed successfully, it signals the success back to the client.
1.337 -
1.338 - This function may leave with one of the system-wide error codes.
1.339 -
1.340 - @param aParams
1.341 - Used to signal startup success back to the client.
1.342 -
1.343 - @since 7.0s
1.344 - */
1.345 - static void DoStartThreadL(TAny* aParam);
1.346 -
1.347 - /**
1.348 - Creates a new session. Only one session may be created with the ControllerProxyServer.
1.349 -
1.350 - This function may leave with one of the system-wide error codes.
1.351 -
1.352 - @param aVersion
1.353 - The version number of the session.
1.354 -
1.355 - @return A pointer to the new session.
1.356 -
1.357 - @since 7.0s
1.358 - */
1.359 - CMmfIpcSession* NewSessionL(const TVersion& aVersion) const;
1.360 -
1.361 - /**
1.362 - Constructor.
1.363 -
1.364 - @since 7.0s
1.365 - */
1.366 - CMMFControllerProxyServer();
1.367 -
1.368 - /**
1.369 - Second phase constructor.
1.370 -
1.371 - @since 7.0s
1.372 - */
1.373 - void ConstructL(RServer2* aServer2);
1.374 -
1.375 - /**
1.376 - Renaming Controller Proxy Server name
1.377 -
1.378 - @since 9.2
1.379 - */
1.380 - static void RenameControllerProxyThread();
1.381 -
1.382 -private:
1.383 - /**
1.384 - The timer used to shut down the server in case the client fails to connect a session.
1.385 - */
1.386 - CMMFControllerProxyShutdown* iShutdownTimer;
1.387 - /**
1.388 - Indicates whether we have a session connected. Only one session is allowed to connect to the server.
1.389 - */
1.390 - TBool iHaveSession;
1.391 - };
1.392 -
1.393 -class CMMFController;
1.394 -
1.395 -/**
1.396 -@internalComponent
1.397 -
1.398 -The controller proxy session.
1.399 -
1.400 -Only one session can be connected to a controller proxy server.
1.401 -
1.402 -@since 7.0s
1.403 -*/
1.404 -class CMMFControllerProxySession : public CMmfIpcSession, public MAsyncEventHandler
1.405 - {
1.406 -public:
1.407 -
1.408 - /**
1.409 - Construct the session.
1.410 -
1.411 - This method may leave with one of the system-wide error codes.
1.412 -
1.413 - @return The newly created server.
1.414 -
1.415 - @since 7.0s
1.416 - */
1.417 - static CMMFControllerProxySession* NewL();
1.418 -
1.419 - /**
1.420 - Second phase constructor called by the CServer base class.
1.421 -
1.422 - This function may leave with one of the system-wide error codes.
1.423 -
1.424 - @param aServer
1.425 - A reference to the server to which this session is attached.
1.426 -
1.427 - @since 7.0s
1.428 - */
1.429 - void CreateL(const CMmfIpcServer& aServer);
1.430 -
1.431 - /**
1.432 - Destructor.
1.433 - */
1.434 - ~CMMFControllerProxySession();
1.435 -
1.436 - /**
1.437 - Called by the CServer baseclass when a request has been made by the client.
1.438 -
1.439 - This function may leave with on of the system-wide error codes. If
1.440 - a leave occurs, the message will be automatically completed by the
1.441 - RunError() of the Controller Proxy Server.
1.442 -
1.443 - @param aMessage
1.444 - The request to be handled. The controller proxy session will create
1.445 - a TMMFMessage from this, and pass on the request to the controller
1.446 - base class to handle.
1.447 -
1.448 - @since 7.0s
1.449 - */
1.450 - void ServiceL(const RMmfIpcMessage& aMessage);
1.451 -
1.452 - /**
1.453 - Derived from MAsyncEventHandler.
1.454 -
1.455 - @see MAsyncEventHandler
1.456 -
1.457 - @since 7.0s
1.458 - */
1.459 - TInt SendEventToClient(const TMMFEvent& aEvent);
1.460 -private:
1.461 - /**
1.462 - Constructor
1.463 - */
1.464 - CMMFControllerProxySession();
1.465 -
1.466 - /**
1.467 - Handle a request from the client to register to receive events from the controller framework.
1.468 -
1.469 - This function may leave with one of the system-wide error codes.
1.470 -
1.471 - @param aMessage
1.472 - The request to be handled.
1.473 -
1.474 - @return ETrue if the message is to be completed now, EFalse if the message will be completed
1.475 - later.
1.476 - */
1.477 - TBool ReceiveEventsL(TMMFMessage& aMessage);
1.478 -
1.479 - /**
1.480 - Handle a request from the client to stop receiving events from the controller framework.
1.481 -
1.482 - This function may leave with one of the system-wide error codes.
1.483 -
1.484 - @param aMessage
1.485 - The request to be handled.
1.486 -
1.487 - @return ETrue if the message is to be completed now, EFalse if the message will be completed later.
1.488 - */
1.489 - TBool CancelReceiveEvents(TMMFMessage& aMessage);
1.490 -
1.491 - /**
1.492 - Handle a request from the client to load a controller plugin.
1.493 -
1.494 - This function may leave with one of the system-wide error codes.
1.495 -
1.496 - @param aMessage
1.497 - The request to be handled.
1.498 -
1.499 - @return ETrue if the message is to be completed now, EFalse if the message will be completed later.
1.500 - */
1.501 - TBool LoadControllerL(TMMFMessage& aMessage);
1.502 -private:
1.503 - /**
1.504 - The controller plugin.
1.505 - */
1.506 - CMMFController* iController;
1.507 - /**
1.508 - A pointer to the server.
1.509 - */
1.510 - CMMFControllerProxyServer* iServer;
1.511 - /**
1.512 - The event receiver. Used to send events to the client.
1.513 - */
1.514 - CMMFEventReceiver* iEventReceiver;
1.515 - /**
1.516 - The events waiting to be sent to the client.
1.517 - */
1.518 - RArray<TMMFEvent> iEvents;
1.519 - };
1.520 -
1.521 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1.522 +#include <mmf/common/mmfcontrollerframeworkclasses.h>
1.523 +#endif
1.524
1.525 #endif